如果在单个任务中sql server创建失败,如何避免创建资源组? [英] how to avoid creating resource group if sql server creation got failed in single task?

查看:80
本文介绍了如果在单个任务中sql server创建失败,如何避免创建资源组?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在逻辑应用程序中使用功能应用程序 

在功能应用程序中通过azure rest调用我在创建资源组的一个任务中创建资源组,服务器和db

,服务器 和db 

如果有任何失败,它应该回滚或不创建前一步骤。
我的问题是在资源创建后它将创建服务器,而服务器创建时间如果它有任何资源组不应创建的例外情况

解决方案

 


最好是在你的情况下使用手臂模板,你需要创建手臂模板:


逻辑应用程序中的异常处理:  http://www.middleway.eu / error-handling-within-azure-logic-apps /


in logic app am using function app 
In function app through azure rest call am creating resource group , server and db
in one task am creating resource group , server  and db 
if anything fails it should rollback or not to create previous step
my question is after resource creation it going to create server while server creation time if it got any exception that resource group should not create

解决方案

Hi, 

The best is to use arm template in your case, you need to create arm template :

https://docs.microsoft.com/en-us/azure/azure-resource-manager/vs-azure-tools-resource-groups-deployment-projects-create-deploy

https://david-obrien.net/2018/05/azure-arm-sql/

After creating the templates you can use following action in logic app highlighted in orange in below screenshot.

But, if don't want to make any change with existing setup, then use scope shape for exception handling in logic apps and in the catch block you can delete the resource group using the shape higlighted in yellow:

Exception handling in logic apps: http://www.middleway.eu/error-handling-within-azure-logic-apps/


这篇关于如果在单个任务中sql server创建失败,如何避免创建资源组?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆