リソース をリソース グループにデプロイします。
テンプレートとパラメーターは、要求内で直接指定することも、JSON ファイルにリンクすることもできます。
PUT https://management.azure.com/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Resources/deployments/{deploymentName}?api-version=2025-04-01
URI パラメーター
名前 |
/ |
必須 |
型 |
説明 |
deploymentName
|
path |
True
|
string
minLength: 1 maxLength: 64 pattern: ^[-\w\._\(\)]+$
|
デプロイメントの名前。
|
resourceGroupName
|
path |
True
|
string
minLength: 1 maxLength: 90 pattern: ^[-\w\._\(\)]+$
|
リソースをデプロイするリソース グループの名前。 名前は大文字と小文字が区別されます。 リソース グループは既に存在している必要があります。
|
subscriptionId
|
path |
True
|
string
|
Microsoft Azure サブスクリプション ID。
|
api-version
|
query |
True
|
string
|
この操作に使用する API バージョン。
|
要求本文
応答
セキュリティ
azure_auth
Azure Active Directory OAuth2 フロー
型:
oauth2
フロー:
implicit
Authorization URL (承認 URL):
https://login.microsoftonline.com/common/oauth2/authorize
スコープ
名前 |
説明 |
user_impersonation
|
ユーザー アカウントを偽装する
|
例
Create a deployment that will deploy a template with a uri and queryString
要求のサンプル
PUT https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000001/resourcegroups/my-resource-group/providers/Microsoft.Resources/deployments/my-deployment?api-version=2025-04-01
{
"properties": {
"templateLink": {
"uri": "https://example.com/exampleTemplate.json",
"queryString": "sv=2019-02-02&st=2019-04-29T22%3A18%3A26Z&se=2019-04-30T02%3A23%3A26Z&sr=b&sp=rw&sip=168.1.5.60-168.1.5.70&spr=https&sig=xxxxxxxx0xxxxxxxxxxxxx%2bxxxxxxxxxxxxxxxxxxxx%3d"
},
"parameters": {},
"mode": "Incremental"
}
}
import com.azure.resourcemanager.resources.fluent.models.DeploymentInner;
import com.azure.resourcemanager.resources.models.DeploymentMode;
import com.azure.resourcemanager.resources.models.DeploymentProperties;
import com.azure.resourcemanager.resources.models.TemplateLink;
import java.util.HashMap;
import java.util.Map;
/**
* Samples for Deployments CreateOrUpdate.
*/
public final class Main {
/*
* x-ms-original-file:
* specification/resources/resource-manager/Microsoft.Resources/deployments/stable/2025-04-01/examples/
* PutDeploymentResourceGroup.json
*/
/**
* Sample code: Create a deployment that will deploy a template with a uri and queryString.
*
* @param azure The entry point for accessing resource management APIs in Azure.
*/
public static void createADeploymentThatWillDeployATemplateWithAUriAndQueryString(
com.azure.resourcemanager.AzureResourceManager azure) {
azure.genericResources().manager().deploymentClient().getDeployments().createOrUpdate("my-resource-group",
"my-deployment",
new DeploymentInner().withProperties(new DeploymentProperties().withTemplateLink(
new TemplateLink().withUri("https://example.com/exampleTemplate.json").withQueryString(
"sv=2019-02-02&st=2019-04-29T22%3A18%3A26Z&se=2019-04-30T02%3A23%3A26Z&sr=b&sp=rw&sip=168.1.5.60-168.1.5.70&spr=https&sig=xxxxxxxx0xxxxxxxxxxxxx%2bxxxxxxxxxxxxxxxxxxxx%3d"))
.withParameters(mapOf()).withMode(DeploymentMode.INCREMENTAL)),
com.azure.core.util.Context.NONE);
}
// Use "Map.of" if available
@SuppressWarnings("unchecked")
private static <T> Map<String, T> mapOf(Object... inputs) {
Map<String, T> map = new HashMap<>();
for (int i = 0; i < inputs.length; i += 2) {
String key = (String) inputs[i];
T value = (T) inputs[i + 1];
map.put(key, value);
}
return map;
}
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
from azure.identity import DefaultAzureCredential
from azure.mgmt.resource.deployments import DeploymentsMgmtClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-resource-deployments
# USAGE
python put_deployment_resource_group.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
"""
def main():
client = DeploymentsMgmtClient(
credential=DefaultAzureCredential(),
subscription_id="00000000-0000-0000-0000-000000000001",
)
response = client.deployments.begin_create_or_update(
resource_group_name="my-resource-group",
deployment_name="my-deployment",
parameters={
"properties": {
"mode": "Incremental",
"parameters": {},
"templateLink": {
"queryString": "sv=2019-02-02&st=2019-04-29T22%3A18%3A26Z&se=2019-04-30T02%3A23%3A26Z&sr=b&sp=rw&sip=168.1.5.60-168.1.5.70&spr=https&sig=xxxxxxxx0xxxxxxxxxxxxx%2bxxxxxxxxxxxxxxxxxxxx%3d",
"uri": "https://example.com/exampleTemplate.json",
},
}
},
).result()
print(response)
# x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/deployments/stable/2025-04-01/examples/PutDeploymentResourceGroup.json
if __name__ == "__main__":
main()
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
package armdeployments_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resources/armdeployments"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/edacc3b43f9603efa119eabb6013d952d1dbe7d6/specification/resources/resource-manager/Microsoft.Resources/deployments/stable/2025-04-01/examples/PutDeploymentResourceGroup.json
func ExampleClient_BeginCreateOrUpdate_createADeploymentThatWillDeployATemplateWithAUriAndQueryString() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armdeployments.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
poller, err := clientFactory.NewClient().BeginCreateOrUpdate(ctx, "my-resource-group", "my-deployment", armdeployments.Deployment{
Properties: &armdeployments.DeploymentProperties{
Mode: to.Ptr(armdeployments.DeploymentModeIncremental),
Parameters: map[string]*armdeployments.DeploymentParameter{},
TemplateLink: &armdeployments.TemplateLink{
QueryString: to.Ptr("sv=2019-02-02&st=2019-04-29T22%3A18%3A26Z&se=2019-04-30T02%3A23%3A26Z&sr=b&sp=rw&sip=168.1.5.60-168.1.5.70&spr=https&sig=xxxxxxxx0xxxxxxxxxxxxx%2bxxxxxxxxxxxxxxxxxxxx%3d"),
URI: to.Ptr("https://example.com/exampleTemplate.json"),
},
},
}, nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
res, err := poller.PollUntilDone(ctx, nil)
if err != nil {
log.Fatalf("failed to pull the result: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res.DeploymentExtended = armdeployments.DeploymentExtended{
// Name: to.Ptr("my-deployment"),
// Type: to.Ptr("Microsoft.Resources/deployments"),
// ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000001/resourceGroups/my-resource-group/providers/Microsoft.Resources/deployments/my-deployment"),
// Properties: &armdeployments.DeploymentPropertiesExtended{
// CorrelationID: to.Ptr("00000000-0000-0000-0000-000000000000"),
// Dependencies: []*armdeployments.Dependency{
// },
// Duration: to.Ptr("PT22.8356799S"),
// Mode: to.Ptr(armdeployments.DeploymentModeIncremental),
// OutputResources: []*armdeployments.ResourceReference{
// {
// ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000001/resourceGroups/my-resource-group/providers/Microsoft.Storage/storageAccounts/my-storage-account"),
// }},
// Parameters: map[string]any{
// },
// Providers: []*armdeployments.Provider{
// {
// Namespace: to.Ptr("Microsoft.Storage"),
// ResourceTypes: []*armdeployments.ProviderResourceType{
// {
// Locations: []*string{
// to.Ptr("eastus")},
// ResourceType: to.Ptr("storageAccounts"),
// }},
// }},
// ProvisioningState: to.Ptr(armdeployments.ProvisioningStateSucceeded),
// TemplateHash: to.Ptr("0000000000000000000"),
// TemplateLink: &armdeployments.TemplateLink{
// ContentVersion: to.Ptr("1.0.0.0"),
// ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000001/resourceGroups/my-resource-group/providers/Microsoft.Resources/TemplateSpecs/TemplateSpec-Name/versions/v1"),
// },
// Timestamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-06-05T01:20:01.723Z"); return t}()),
// },
// }
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
const { DeploymentsClient } = require("@azure/arm-resourcesdeployments");
const { DefaultAzureCredential } = require("@azure/identity");
require("dotenv/config");
/**
* This sample demonstrates how to You can provide the template and parameters directly in the request or link to JSON files.
*
* @summary You can provide the template and parameters directly in the request or link to JSON files.
* x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/deployments/stable/2025-04-01/examples/PutDeploymentResourceGroup.json
*/
async function createADeploymentThatWillDeployATemplateWithAUriAndQueryString() {
const subscriptionId =
process.env["RESOURCES_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000001";
const resourceGroupName = process.env["RESOURCES_RESOURCE_GROUP"] || "my-resource-group";
const deploymentName = "my-deployment";
const parameters = {
properties: {
mode: "Incremental",
parameters: {},
templateLink: {
queryString:
"sv=2019-02-02&st=2019-04-29T22%3A18%3A26Z&se=2019-04-30T02%3A23%3A26Z&sr=b&sp=rw&sip=168.1.5.60-168.1.5.70&spr=https&sig=xxxxxxxx0xxxxxxxxxxxxx%2bxxxxxxxxxxxxxxxxxxxx%3d",
uri: "https://example.com/exampleTemplate.json",
},
},
};
const credential = new DefaultAzureCredential();
const client = new DeploymentsClient(credential, subscriptionId);
const result = await client.deployments.beginCreateOrUpdateAndWait(
resourceGroupName,
deploymentName,
parameters,
);
console.log(result);
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
応答のサンプル
{
"id": "/subscriptions/00000000-0000-0000-0000-000000000001/resourceGroups/my-resource-group/providers/Microsoft.Resources/deployments/my-deployment",
"name": "my-deployment",
"type": "Microsoft.Resources/deployments",
"properties": {
"templateLink": {
"id": "/subscriptions/00000000-0000-0000-0000-000000000001/resourceGroups/my-resource-group/providers/Microsoft.Resources/TemplateSpecs/TemplateSpec-Name/versions/v1",
"contentVersion": "1.0.0.0"
},
"templateHash": "0000000000000000000",
"parameters": {},
"mode": "Incremental",
"provisioningState": "Succeeded",
"timestamp": "2020-06-05T01:20:01.723776Z",
"duration": "PT22.8356799S",
"correlationId": "00000000-0000-0000-0000-000000000000",
"providers": [
{
"namespace": "Microsoft.Storage",
"resourceTypes": [
{
"resourceType": "storageAccounts",
"locations": [
"eastus"
]
}
]
}
],
"dependencies": [],
"outputResources": [
{
"id": "/subscriptions/00000000-0000-0000-0000-000000000001/resourceGroups/my-resource-group/providers/Microsoft.Storage/storageAccounts/my-storage-account"
}
]
}
}
{
"id": "/subscriptions/00000000-0000-0000-0000-000000000001/resourceGroups/my-resource-group/providers/Microsoft.Resources/deployments/my-deployment",
"name": "my-deployment",
"type": "Microsoft.Resources/deployments",
"properties": {
"templateLink": {
"id": "/subscriptions/00000000-0000-0000-0000-000000000001/resourceGroups/my-resource-group/providers/Microsoft.Resources/TemplateSpecs/TemplateSpec-Name/versions/v1",
"contentVersion": "1.0.0.0"
},
"templateHash": "0000000000000000000",
"parameters": {},
"mode": "Incremental",
"provisioningState": "Accepted",
"timestamp": "2020-06-05T01:20:01.723776Z",
"duration": "PT22.8356799S",
"correlationId": "00000000-0000-0000-0000-000000000000",
"providers": [
{
"namespace": "Microsoft.Storage",
"resourceTypes": [
{
"resourceType": "storageAccounts",
"locations": [
"eastus"
]
}
]
}
],
"dependencies": []
}
}
Create a deployment that will deploy a templateSpec with the given resourceId
要求のサンプル
PUT https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000001/resourcegroups/my-resource-group/providers/Microsoft.Resources/deployments/my-deployment?api-version=2025-04-01
{
"properties": {
"templateLink": {
"id": "/subscriptions/00000000-0000-0000-0000-000000000001/resourceGroups/my-resource-group/providers/Microsoft.Resources/TemplateSpecs/TemplateSpec-Name/versions/v1"
},
"parameters": {},
"mode": "Incremental"
}
}
import com.azure.resourcemanager.resources.fluent.models.DeploymentInner;
import com.azure.resourcemanager.resources.models.DeploymentMode;
import com.azure.resourcemanager.resources.models.DeploymentProperties;
import com.azure.resourcemanager.resources.models.TemplateLink;
import java.util.HashMap;
import java.util.Map;
/**
* Samples for Deployments CreateOrUpdate.
*/
public final class Main {
/*
* x-ms-original-file:
* specification/resources/resource-manager/Microsoft.Resources/deployments/stable/2025-04-01/examples/
* PutDeploymentResourceGroupTemplateSpecsWithId.json
*/
/**
* Sample code: Create a deployment that will deploy a templateSpec with the given resourceId.
*
* @param azure The entry point for accessing resource management APIs in Azure.
*/
public static void createADeploymentThatWillDeployATemplateSpecWithTheGivenResourceId(
com.azure.resourcemanager.AzureResourceManager azure) {
azure.genericResources().manager().deploymentClient().getDeployments().createOrUpdate("my-resource-group",
"my-deployment",
new DeploymentInner().withProperties(new DeploymentProperties().withTemplateLink(new TemplateLink().withId(
"/subscriptions/00000000-0000-0000-0000-000000000001/resourceGroups/my-resource-group/providers/Microsoft.Resources/TemplateSpecs/TemplateSpec-Name/versions/v1"))
.withParameters(mapOf()).withMode(DeploymentMode.INCREMENTAL)),
com.azure.core.util.Context.NONE);
}
// Use "Map.of" if available
@SuppressWarnings("unchecked")
private static <T> Map<String, T> mapOf(Object... inputs) {
Map<String, T> map = new HashMap<>();
for (int i = 0; i < inputs.length; i += 2) {
String key = (String) inputs[i];
T value = (T) inputs[i + 1];
map.put(key, value);
}
return map;
}
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
from azure.identity import DefaultAzureCredential
from azure.mgmt.resource.deployments import DeploymentsMgmtClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-resource-deployments
# USAGE
python put_deployment_resource_group_template_specs_with_id.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
"""
def main():
client = DeploymentsMgmtClient(
credential=DefaultAzureCredential(),
subscription_id="00000000-0000-0000-0000-000000000001",
)
response = client.deployments.begin_create_or_update(
resource_group_name="my-resource-group",
deployment_name="my-deployment",
parameters={
"properties": {
"mode": "Incremental",
"parameters": {},
"templateLink": {
"id": "/subscriptions/00000000-0000-0000-0000-000000000001/resourceGroups/my-resource-group/providers/Microsoft.Resources/TemplateSpecs/TemplateSpec-Name/versions/v1"
},
}
},
).result()
print(response)
# x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/deployments/stable/2025-04-01/examples/PutDeploymentResourceGroupTemplateSpecsWithId.json
if __name__ == "__main__":
main()
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
package armdeployments_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resources/armdeployments"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/edacc3b43f9603efa119eabb6013d952d1dbe7d6/specification/resources/resource-manager/Microsoft.Resources/deployments/stable/2025-04-01/examples/PutDeploymentResourceGroupTemplateSpecsWithId.json
func ExampleClient_BeginCreateOrUpdate_createADeploymentThatWillDeployATemplateSpecWithTheGivenResourceId() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armdeployments.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
poller, err := clientFactory.NewClient().BeginCreateOrUpdate(ctx, "my-resource-group", "my-deployment", armdeployments.Deployment{
Properties: &armdeployments.DeploymentProperties{
Mode: to.Ptr(armdeployments.DeploymentModeIncremental),
Parameters: map[string]*armdeployments.DeploymentParameter{},
TemplateLink: &armdeployments.TemplateLink{
ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000001/resourceGroups/my-resource-group/providers/Microsoft.Resources/TemplateSpecs/TemplateSpec-Name/versions/v1"),
},
},
}, nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
res, err := poller.PollUntilDone(ctx, nil)
if err != nil {
log.Fatalf("failed to pull the result: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res.DeploymentExtended = armdeployments.DeploymentExtended{
// Name: to.Ptr("my-deployment"),
// Type: to.Ptr("Microsoft.Resources/deployments"),
// ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000001/resourceGroups/my-resource-group/providers/Microsoft.Resources/deployments/my-deployment"),
// Properties: &armdeployments.DeploymentPropertiesExtended{
// CorrelationID: to.Ptr("00000000-0000-0000-0000-000000000000"),
// Dependencies: []*armdeployments.Dependency{
// },
// Duration: to.Ptr("PT22.8356799S"),
// Mode: to.Ptr(armdeployments.DeploymentModeIncremental),
// OutputResources: []*armdeployments.ResourceReference{
// {
// ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000001/resourceGroups/my-resource-group/providers/Microsoft.Storage/storageAccounts/my-storage-account"),
// }},
// Parameters: map[string]any{
// },
// Providers: []*armdeployments.Provider{
// {
// Namespace: to.Ptr("Microsoft.Storage"),
// ResourceTypes: []*armdeployments.ProviderResourceType{
// {
// Locations: []*string{
// to.Ptr("eastus")},
// ResourceType: to.Ptr("storageAccounts"),
// }},
// }},
// ProvisioningState: to.Ptr(armdeployments.ProvisioningStateSucceeded),
// TemplateHash: to.Ptr("0000000000000000000"),
// TemplateLink: &armdeployments.TemplateLink{
// ContentVersion: to.Ptr("1.0.0.0"),
// ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000001/resourceGroups/my-resource-group/providers/Microsoft.Resources/TemplateSpecs/TemplateSpec-Name/versions/v1"),
// },
// Timestamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-06-05T01:20:01.723Z"); return t}()),
// },
// }
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
const { DeploymentsClient } = require("@azure/arm-resourcesdeployments");
const { DefaultAzureCredential } = require("@azure/identity");
require("dotenv/config");
/**
* This sample demonstrates how to You can provide the template and parameters directly in the request or link to JSON files.
*
* @summary You can provide the template and parameters directly in the request or link to JSON files.
* x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/deployments/stable/2025-04-01/examples/PutDeploymentResourceGroupTemplateSpecsWithId.json
*/
async function createADeploymentThatWillDeployATemplateSpecWithTheGivenResourceId() {
const subscriptionId =
process.env["RESOURCES_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000001";
const resourceGroupName = process.env["RESOURCES_RESOURCE_GROUP"] || "my-resource-group";
const deploymentName = "my-deployment";
const parameters = {
properties: {
mode: "Incremental",
parameters: {},
templateLink: {
id: "/subscriptions/00000000-0000-0000-0000-000000000001/resourceGroups/my-resource-group/providers/Microsoft.Resources/TemplateSpecs/TemplateSpec-Name/versions/v1",
},
},
};
const credential = new DefaultAzureCredential();
const client = new DeploymentsClient(credential, subscriptionId);
const result = await client.deployments.beginCreateOrUpdateAndWait(
resourceGroupName,
deploymentName,
parameters,
);
console.log(result);
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
応答のサンプル
{
"id": "/subscriptions/00000000-0000-0000-0000-000000000001/resourceGroups/my-resource-group/providers/Microsoft.Resources/deployments/my-deployment",
"name": "my-deployment",
"type": "Microsoft.Resources/deployments",
"properties": {
"templateLink": {
"id": "/subscriptions/00000000-0000-0000-0000-000000000001/resourceGroups/my-resource-group/providers/Microsoft.Resources/TemplateSpecs/TemplateSpec-Name/versions/v1",
"contentVersion": "1.0.0.0"
},
"templateHash": "0000000000000000000",
"parameters": {},
"mode": "Incremental",
"provisioningState": "Succeeded",
"timestamp": "2020-06-05T01:20:01.723776Z",
"duration": "PT22.8356799S",
"correlationId": "00000000-0000-0000-0000-000000000000",
"providers": [
{
"namespace": "Microsoft.Storage",
"resourceTypes": [
{
"resourceType": "storageAccounts",
"locations": [
"eastus"
]
}
]
}
],
"dependencies": [],
"outputResources": [
{
"id": "/subscriptions/00000000-0000-0000-0000-000000000001/resourceGroups/my-resource-group/providers/Microsoft.Storage/storageAccounts/my-storage-account"
}
]
}
}
{
"id": "/subscriptions/00000000-0000-0000-0000-000000000001/resourceGroups/my-resource-group/providers/Microsoft.Resources/deployments/my-deployment",
"name": "my-deployment",
"type": "Microsoft.Resources/deployments",
"properties": {
"templateLink": {
"id": "/subscriptions/00000000-0000-0000-0000-000000000001/resourceGroups/my-resource-group/providers/Microsoft.Resources/TemplateSpecs/TemplateSpec-Name/versions/v1",
"contentVersion": "1.0.0.0"
},
"templateHash": "0000000000000000000",
"parameters": {},
"mode": "Incremental",
"provisioningState": "Accepted",
"timestamp": "2020-06-05T01:20:01.723776Z",
"duration": "PT22.8356799S",
"correlationId": "00000000-0000-0000-0000-000000000000",
"providers": [
{
"namespace": "Microsoft.Storage",
"resourceTypes": [
{
"resourceType": "storageAccounts",
"locations": [
"eastus"
]
}
]
}
],
"dependencies": []
}
}
Create a deployment that will redeploy another deployment on failure
要求のサンプル
PUT https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/my-resource-group/providers/Microsoft.Resources/deployments/my-deployment?api-version=2025-04-01
{
"properties": {
"templateLink": {
"uri": "https://example.com/exampleTemplate.json"
},
"parameters": {},
"mode": "Complete",
"onErrorDeployment": {
"type": "SpecificDeployment",
"deploymentName": "name-of-deployment-to-use"
}
}
}
import com.azure.resourcemanager.resources.fluent.models.DeploymentInner;
import com.azure.resourcemanager.resources.models.DeploymentMode;
import com.azure.resourcemanager.resources.models.DeploymentProperties;
import com.azure.resourcemanager.resources.models.OnErrorDeployment;
import com.azure.resourcemanager.resources.models.OnErrorDeploymentType;
import com.azure.resourcemanager.resources.models.TemplateLink;
import java.util.HashMap;
import java.util.Map;
/**
* Samples for Deployments CreateOrUpdate.
*/
public final class Main {
/*
* x-ms-original-file:
* specification/resources/resource-manager/Microsoft.Resources/deployments/stable/2025-04-01/examples/
* PutDeploymentWithOnErrorDeploymentSpecificDeployment.json
*/
/**
* Sample code: Create a deployment that will redeploy another deployment on failure.
*
* @param azure The entry point for accessing resource management APIs in Azure.
*/
public static void createADeploymentThatWillRedeployAnotherDeploymentOnFailure(
com.azure.resourcemanager.AzureResourceManager azure) {
azure.genericResources().manager().deploymentClient().getDeployments().createOrUpdate("my-resource-group",
"my-deployment",
new DeploymentInner().withProperties(new DeploymentProperties()
.withTemplateLink(new TemplateLink().withUri("https://example.com/exampleTemplate.json"))
.withParameters(mapOf()).withMode(DeploymentMode.COMPLETE)
.withOnErrorDeployment(new OnErrorDeployment().withType(OnErrorDeploymentType.SPECIFIC_DEPLOYMENT)
.withDeploymentName("name-of-deployment-to-use"))),
com.azure.core.util.Context.NONE);
}
// Use "Map.of" if available
@SuppressWarnings("unchecked")
private static <T> Map<String, T> mapOf(Object... inputs) {
Map<String, T> map = new HashMap<>();
for (int i = 0; i < inputs.length; i += 2) {
String key = (String) inputs[i];
T value = (T) inputs[i + 1];
map.put(key, value);
}
return map;
}
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
from azure.identity import DefaultAzureCredential
from azure.mgmt.resource.deployments import DeploymentsMgmtClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-resource-deployments
# USAGE
python put_deployment_with_on_error_deployment_specific_deployment.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
"""
def main():
client = DeploymentsMgmtClient(
credential=DefaultAzureCredential(),
subscription_id="00000000-0000-0000-0000-000000000000",
)
response = client.deployments.begin_create_or_update(
resource_group_name="my-resource-group",
deployment_name="my-deployment",
parameters={
"properties": {
"mode": "Complete",
"onErrorDeployment": {"deploymentName": "name-of-deployment-to-use", "type": "SpecificDeployment"},
"parameters": {},
"templateLink": {"uri": "https://example.com/exampleTemplate.json"},
}
},
).result()
print(response)
# x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/deployments/stable/2025-04-01/examples/PutDeploymentWithOnErrorDeploymentSpecificDeployment.json
if __name__ == "__main__":
main()
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
package armdeployments_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resources/armdeployments"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/edacc3b43f9603efa119eabb6013d952d1dbe7d6/specification/resources/resource-manager/Microsoft.Resources/deployments/stable/2025-04-01/examples/PutDeploymentWithOnErrorDeploymentSpecificDeployment.json
func ExampleClient_BeginCreateOrUpdate_createADeploymentThatWillRedeployAnotherDeploymentOnFailure() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armdeployments.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
poller, err := clientFactory.NewClient().BeginCreateOrUpdate(ctx, "my-resource-group", "my-deployment", armdeployments.Deployment{
Properties: &armdeployments.DeploymentProperties{
Mode: to.Ptr(armdeployments.DeploymentModeComplete),
OnErrorDeployment: &armdeployments.OnErrorDeployment{
Type: to.Ptr(armdeployments.OnErrorDeploymentTypeSpecificDeployment),
DeploymentName: to.Ptr("name-of-deployment-to-use"),
},
Parameters: map[string]*armdeployments.DeploymentParameter{},
TemplateLink: &armdeployments.TemplateLink{
URI: to.Ptr("https://example.com/exampleTemplate.json"),
},
},
}, nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
res, err := poller.PollUntilDone(ctx, nil)
if err != nil {
log.Fatalf("failed to pull the result: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res.DeploymentExtended = armdeployments.DeploymentExtended{
// Name: to.Ptr("my-deployment"),
// Type: to.Ptr("Microsoft.Resources/deployments"),
// ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/my-resource-group/providers/Microsoft.Resources/deployments/my-deployment"),
// Properties: &armdeployments.DeploymentPropertiesExtended{
// CorrelationID: to.Ptr("00000000-0000-0000-0000-000000000000"),
// Dependencies: []*armdeployments.Dependency{
// {
// DependsOn: []*armdeployments.BasicDependency{
// {
// ID: to.Ptr("{resourceid}"),
// ResourceName: to.Ptr("VNet1"),
// ResourceType: to.Ptr("Microsoft.Network/virtualNetworks"),
// }},
// ID: to.Ptr("{resourceid}"),
// ResourceName: to.Ptr("VNet1/Subnet1"),
// ResourceType: to.Ptr("Microsoft.Network/virtualNetworks/subnets"),
// },
// {
// DependsOn: []*armdeployments.BasicDependency{
// {
// ID: to.Ptr("{resourceid}"),
// ResourceName: to.Ptr("VNet1"),
// ResourceType: to.Ptr("Microsoft.Network/virtualNetworks"),
// },
// {
// ID: to.Ptr("{resourceid}"),
// ResourceName: to.Ptr("VNet1/Subnet1"),
// ResourceType: to.Ptr("Microsoft.Network/virtualNetworks/subnets"),
// }},
// ID: to.Ptr("{resourceid}"),
// ResourceName: to.Ptr("VNet1/Subnet2"),
// ResourceType: to.Ptr("Microsoft.Network/virtualNetworks/subnets"),
// }},
// Duration: to.Ptr("PT0.8204881S"),
// Mode: to.Ptr(armdeployments.DeploymentModeComplete),
// OnErrorDeployment: &armdeployments.OnErrorDeploymentExtended{
// Type: to.Ptr(armdeployments.OnErrorDeploymentTypeSpecificDeployment),
// DeploymentName: to.Ptr("name-of-deployment-to-use"),
// },
// Parameters: map[string]any{
// },
// Providers: []*armdeployments.Provider{
// {
// Namespace: to.Ptr("Microsoft.Network"),
// ResourceTypes: []*armdeployments.ProviderResourceType{
// {
// Locations: []*string{
// to.Ptr("centralus")},
// ResourceType: to.Ptr("virtualNetworks"),
// },
// {
// Locations: []*string{
// to.Ptr("centralus")},
// ResourceType: to.Ptr("virtualNetworks/subnets"),
// }},
// }},
// ProvisioningState: to.Ptr(armdeployments.ProvisioningStateSucceeded),
// TemplateLink: &armdeployments.TemplateLink{
// ContentVersion: to.Ptr("1.0.0.0"),
// URI: to.Ptr("https://example.com/exampleTemplate.json"),
// },
// Timestamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-03-01T00:00:00.000Z"); return t}()),
// },
// }
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
const { DeploymentsClient } = require("@azure/arm-resourcesdeployments");
const { DefaultAzureCredential } = require("@azure/identity");
require("dotenv/config");
/**
* This sample demonstrates how to You can provide the template and parameters directly in the request or link to JSON files.
*
* @summary You can provide the template and parameters directly in the request or link to JSON files.
* x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/deployments/stable/2025-04-01/examples/PutDeploymentWithOnErrorDeploymentSpecificDeployment.json
*/
async function createADeploymentThatWillRedeployAnotherDeploymentOnFailure() {
const subscriptionId =
process.env["RESOURCES_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000";
const resourceGroupName = process.env["RESOURCES_RESOURCE_GROUP"] || "my-resource-group";
const deploymentName = "my-deployment";
const parameters = {
properties: {
mode: "Complete",
onErrorDeployment: {
type: "SpecificDeployment",
deploymentName: "name-of-deployment-to-use",
},
parameters: {},
templateLink: { uri: "https://example.com/exampleTemplate.json" },
},
};
const credential = new DefaultAzureCredential();
const client = new DeploymentsClient(credential, subscriptionId);
const result = await client.deployments.beginCreateOrUpdateAndWait(
resourceGroupName,
deploymentName,
parameters,
);
console.log(result);
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
応答のサンプル
{
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/my-resource-group/providers/Microsoft.Resources/deployments/my-deployment",
"name": "my-deployment",
"type": "Microsoft.Resources/deployments",
"properties": {
"templateLink": {
"uri": "https://example.com/exampleTemplate.json",
"contentVersion": "1.0.0.0"
},
"parameters": {},
"mode": "Complete",
"provisioningState": "Accepted",
"timestamp": "2019-03-01T00:00:00.0000000Z",
"duration": "PT0.8204881S",
"correlationId": "00000000-0000-0000-0000-000000000000",
"providers": [
{
"namespace": "Microsoft.Network",
"resourceTypes": [
{
"resourceType": "virtualNetworks",
"locations": [
"centralus"
]
},
{
"resourceType": "virtualNetworks/subnets",
"locations": [
"centralus"
]
}
]
}
],
"dependencies": [
{
"dependsOn": [
{
"id": "{resourceid}",
"resourceType": "Microsoft.Network/virtualNetworks",
"resourceName": "VNet1"
}
],
"id": "{resourceid}",
"resourceType": "Microsoft.Network/virtualNetworks/subnets",
"resourceName": "VNet1/Subnet1"
},
{
"dependsOn": [
{
"id": "{resourceid}",
"resourceType": "Microsoft.Network/virtualNetworks",
"resourceName": "VNet1"
},
{
"id": "{resourceid}",
"resourceType": "Microsoft.Network/virtualNetworks/subnets",
"resourceName": "VNet1/Subnet1"
}
],
"id": "{resourceid}",
"resourceType": "Microsoft.Network/virtualNetworks/subnets",
"resourceName": "VNet1/Subnet2"
}
],
"onErrorDeployment": {
"type": "SpecificDeployment",
"deploymentName": "name-of-deployment-to-use"
}
}
}
{
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/my-resource-group/providers/Microsoft.Resources/deployments/my-deployment",
"name": "my-deployment",
"type": "Microsoft.Resources/deployments",
"properties": {
"templateLink": {
"uri": "https://example.com/exampleTemplate.json",
"contentVersion": "1.0.0.0"
},
"parameters": {},
"mode": "Complete",
"provisioningState": "Accepted",
"timestamp": "2019-03-01T00:00:00.0000000Z",
"duration": "PT0.8204881S",
"correlationId": "00000000-0000-0000-0000-000000000000",
"providers": [
{
"namespace": "Microsoft.Network",
"resourceTypes": [
{
"resourceType": "virtualNetworks",
"locations": [
"centralus"
]
},
{
"resourceType": "virtualNetworks/subnets",
"locations": [
"centralus"
]
}
]
}
],
"dependencies": [
{
"dependsOn": [
{
"id": "{resourceid}",
"resourceType": "Microsoft.Network/virtualNetworks",
"resourceName": "VNet1"
}
],
"id": "{resourceid}",
"resourceType": "Microsoft.Network/virtualNetworks/subnets",
"resourceName": "VNet1/Subnet1"
},
{
"dependsOn": [
{
"id": "{resourceid}",
"resourceType": "Microsoft.Network/virtualNetworks",
"resourceName": "VNet1"
},
{
"id": "{resourceid}",
"resourceType": "Microsoft.Network/virtualNetworks/subnets",
"resourceName": "VNet1/Subnet1"
}
],
"id": "{resourceid}",
"resourceType": "Microsoft.Network/virtualNetworks/subnets",
"resourceName": "VNet1/Subnet2"
}
],
"onErrorDeployment": {
"type": "SpecificDeployment",
"deploymentName": "name-of-deployment-to-use"
}
}
}
Create a deployment that will redeploy the last successful deployment on failure
要求のサンプル
PUT https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/my-resource-group/providers/Microsoft.Resources/deployments/my-deployment?api-version=2025-04-01
{
"properties": {
"templateLink": {
"uri": "https://example.com/exampleTemplate.json"
},
"parameters": {},
"mode": "Complete",
"onErrorDeployment": {
"type": "LastSuccessful"
}
}
}
import com.azure.resourcemanager.resources.fluent.models.DeploymentInner;
import com.azure.resourcemanager.resources.models.DeploymentMode;
import com.azure.resourcemanager.resources.models.DeploymentProperties;
import com.azure.resourcemanager.resources.models.OnErrorDeployment;
import com.azure.resourcemanager.resources.models.OnErrorDeploymentType;
import com.azure.resourcemanager.resources.models.TemplateLink;
import java.util.HashMap;
import java.util.Map;
/**
* Samples for Deployments CreateOrUpdate.
*/
public final class Main {
/*
* x-ms-original-file:
* specification/resources/resource-manager/Microsoft.Resources/deployments/stable/2025-04-01/examples/
* PutDeploymentWithOnErrorDeploymentLastSuccessful.json
*/
/**
* Sample code: Create a deployment that will redeploy the last successful deployment on failure.
*
* @param azure The entry point for accessing resource management APIs in Azure.
*/
public static void createADeploymentThatWillRedeployTheLastSuccessfulDeploymentOnFailure(
com.azure.resourcemanager.AzureResourceManager azure) {
azure.genericResources().manager().deploymentClient().getDeployments().createOrUpdate("my-resource-group",
"my-deployment",
new DeploymentInner().withProperties(new DeploymentProperties()
.withTemplateLink(new TemplateLink().withUri("https://example.com/exampleTemplate.json"))
.withParameters(mapOf()).withMode(DeploymentMode.COMPLETE)
.withOnErrorDeployment(new OnErrorDeployment().withType(OnErrorDeploymentType.LAST_SUCCESSFUL))),
com.azure.core.util.Context.NONE);
}
// Use "Map.of" if available
@SuppressWarnings("unchecked")
private static <T> Map<String, T> mapOf(Object... inputs) {
Map<String, T> map = new HashMap<>();
for (int i = 0; i < inputs.length; i += 2) {
String key = (String) inputs[i];
T value = (T) inputs[i + 1];
map.put(key, value);
}
return map;
}
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
from azure.identity import DefaultAzureCredential
from azure.mgmt.resource.deployments import DeploymentsMgmtClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-resource-deployments
# USAGE
python put_deployment_with_on_error_deployment_last_successful.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
"""
def main():
client = DeploymentsMgmtClient(
credential=DefaultAzureCredential(),
subscription_id="00000000-0000-0000-0000-000000000000",
)
response = client.deployments.begin_create_or_update(
resource_group_name="my-resource-group",
deployment_name="my-deployment",
parameters={
"properties": {
"mode": "Complete",
"onErrorDeployment": {"type": "LastSuccessful"},
"parameters": {},
"templateLink": {"uri": "https://example.com/exampleTemplate.json"},
}
},
).result()
print(response)
# x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/deployments/stable/2025-04-01/examples/PutDeploymentWithOnErrorDeploymentLastSuccessful.json
if __name__ == "__main__":
main()
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
package armdeployments_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resources/armdeployments"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/edacc3b43f9603efa119eabb6013d952d1dbe7d6/specification/resources/resource-manager/Microsoft.Resources/deployments/stable/2025-04-01/examples/PutDeploymentWithOnErrorDeploymentLastSuccessful.json
func ExampleClient_BeginCreateOrUpdate_createADeploymentThatWillRedeployTheLastSuccessfulDeploymentOnFailure() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armdeployments.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
poller, err := clientFactory.NewClient().BeginCreateOrUpdate(ctx, "my-resource-group", "my-deployment", armdeployments.Deployment{
Properties: &armdeployments.DeploymentProperties{
Mode: to.Ptr(armdeployments.DeploymentModeComplete),
OnErrorDeployment: &armdeployments.OnErrorDeployment{
Type: to.Ptr(armdeployments.OnErrorDeploymentTypeLastSuccessful),
},
Parameters: map[string]*armdeployments.DeploymentParameter{},
TemplateLink: &armdeployments.TemplateLink{
URI: to.Ptr("https://example.com/exampleTemplate.json"),
},
},
}, nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
res, err := poller.PollUntilDone(ctx, nil)
if err != nil {
log.Fatalf("failed to pull the result: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res.DeploymentExtended = armdeployments.DeploymentExtended{
// Name: to.Ptr("my-deployment"),
// Type: to.Ptr("Microsoft.Resources/deployments"),
// ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/my-resource-group/providers/Microsoft.Resources/deployments/my-deployment"),
// Properties: &armdeployments.DeploymentPropertiesExtended{
// CorrelationID: to.Ptr("00000000-0000-0000-0000-000000000000"),
// Dependencies: []*armdeployments.Dependency{
// {
// DependsOn: []*armdeployments.BasicDependency{
// {
// ID: to.Ptr("{resourceid}"),
// ResourceName: to.Ptr("VNet1"),
// ResourceType: to.Ptr("Microsoft.Network/virtualNetworks"),
// }},
// ID: to.Ptr("{resourceid}"),
// ResourceName: to.Ptr("VNet1/Subnet1"),
// ResourceType: to.Ptr("Microsoft.Network/virtualNetworks/subnets"),
// },
// {
// DependsOn: []*armdeployments.BasicDependency{
// {
// ID: to.Ptr("{resourceid}"),
// ResourceName: to.Ptr("VNet1"),
// ResourceType: to.Ptr("Microsoft.Network/virtualNetworks"),
// },
// {
// ID: to.Ptr("{resourceid}"),
// ResourceName: to.Ptr("VNet1/Subnet1"),
// ResourceType: to.Ptr("Microsoft.Network/virtualNetworks/subnets"),
// }},
// ID: to.Ptr("{resourceid}"),
// ResourceName: to.Ptr("VNet1/Subnet2"),
// ResourceType: to.Ptr("Microsoft.Network/virtualNetworks/subnets"),
// }},
// Duration: to.Ptr("PT0.8204881S"),
// Mode: to.Ptr(armdeployments.DeploymentModeComplete),
// OnErrorDeployment: &armdeployments.OnErrorDeploymentExtended{
// Type: to.Ptr(armdeployments.OnErrorDeploymentTypeLastSuccessful),
// DeploymentName: to.Ptr("{nameOfLastSuccesfulDeployment}"),
// },
// Parameters: map[string]any{
// },
// Providers: []*armdeployments.Provider{
// {
// Namespace: to.Ptr("Microsoft.Network"),
// ResourceTypes: []*armdeployments.ProviderResourceType{
// {
// Locations: []*string{
// to.Ptr("centralus")},
// ResourceType: to.Ptr("virtualNetworks"),
// },
// {
// Locations: []*string{
// to.Ptr("centralus")},
// ResourceType: to.Ptr("virtualNetworks/subnets"),
// }},
// }},
// ProvisioningState: to.Ptr(armdeployments.ProvisioningStateSucceeded),
// TemplateLink: &armdeployments.TemplateLink{
// ContentVersion: to.Ptr("1.0.0.0"),
// URI: to.Ptr("https://example.com/exampleTemplate.json"),
// },
// Timestamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-03-01T00:00:00.000Z"); return t}()),
// },
// }
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
const { DeploymentsClient } = require("@azure/arm-resourcesdeployments");
const { DefaultAzureCredential } = require("@azure/identity");
require("dotenv/config");
/**
* This sample demonstrates how to You can provide the template and parameters directly in the request or link to JSON files.
*
* @summary You can provide the template and parameters directly in the request or link to JSON files.
* x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/deployments/stable/2025-04-01/examples/PutDeploymentWithOnErrorDeploymentLastSuccessful.json
*/
async function createADeploymentThatWillRedeployTheLastSuccessfulDeploymentOnFailure() {
const subscriptionId =
process.env["RESOURCES_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000";
const resourceGroupName = process.env["RESOURCES_RESOURCE_GROUP"] || "my-resource-group";
const deploymentName = "my-deployment";
const parameters = {
properties: {
mode: "Complete",
onErrorDeployment: { type: "LastSuccessful" },
parameters: {},
templateLink: { uri: "https://example.com/exampleTemplate.json" },
},
};
const credential = new DefaultAzureCredential();
const client = new DeploymentsClient(credential, subscriptionId);
const result = await client.deployments.beginCreateOrUpdateAndWait(
resourceGroupName,
deploymentName,
parameters,
);
console.log(result);
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
応答のサンプル
{
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/my-resource-group/providers/Microsoft.Resources/deployments/my-deployment",
"name": "my-deployment",
"type": "Microsoft.Resources/deployments",
"properties": {
"templateLink": {
"uri": "https://example.com/exampleTemplate.json",
"contentVersion": "1.0.0.0"
},
"parameters": {},
"mode": "Complete",
"provisioningState": "Accepted",
"timestamp": "2019-03-01T00:00:00.0000000Z",
"duration": "PT0.8204881S",
"correlationId": "00000000-0000-0000-0000-000000000000",
"providers": [
{
"namespace": "Microsoft.Network",
"resourceTypes": [
{
"resourceType": "virtualNetworks",
"locations": [
"centralus"
]
},
{
"resourceType": "virtualNetworks/subnets",
"locations": [
"centralus"
]
}
]
}
],
"dependencies": [
{
"dependsOn": [
{
"id": "{resourceid}",
"resourceType": "Microsoft.Network/virtualNetworks",
"resourceName": "VNet1"
}
],
"id": "{resourceid}",
"resourceType": "Microsoft.Network/virtualNetworks/subnets",
"resourceName": "VNet1/Subnet1"
},
{
"dependsOn": [
{
"id": "{resourceid}",
"resourceType": "Microsoft.Network/virtualNetworks",
"resourceName": "VNet1"
},
{
"id": "{resourceid}",
"resourceType": "Microsoft.Network/virtualNetworks/subnets",
"resourceName": "VNet1/Subnet1"
}
],
"id": "{resourceid}",
"resourceType": "Microsoft.Network/virtualNetworks/subnets",
"resourceName": "VNet1/Subnet2"
}
],
"onErrorDeployment": {
"type": "LastSuccessful",
"deploymentName": "{nameOfLastSuccesfulDeployment}"
}
}
}
{
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/my-resource-group/providers/Microsoft.Resources/deployments/my-deployment",
"name": "my-deployment",
"type": "Microsoft.Resources/deployments",
"properties": {
"templateLink": {
"uri": "https://example.com/exampleTemplate.json",
"contentVersion": "1.0.0.0"
},
"parameters": {},
"mode": "Complete",
"provisioningState": "Accepted",
"timestamp": "2019-03-01T00:00:00.0000000Z",
"duration": "PT0.8204881S",
"correlationId": "00000000-0000-0000-0000-000000000000",
"providers": [
{
"namespace": "Microsoft.Network",
"resourceTypes": [
{
"resourceType": "virtualNetworks",
"locations": [
"centralus"
]
},
{
"resourceType": "virtualNetworks/subnets",
"locations": [
"centralus"
]
}
]
}
],
"dependencies": [
{
"dependsOn": [
{
"id": "{resourceid}",
"resourceType": "Microsoft.Network/virtualNetworks",
"resourceName": "VNet1"
}
],
"id": "{resourceid}",
"resourceType": "Microsoft.Network/virtualNetworks/subnets",
"resourceName": "VNet1/Subnet1"
},
{
"dependsOn": [
{
"id": "{resourceid}",
"resourceType": "Microsoft.Network/virtualNetworks",
"resourceName": "VNet1"
},
{
"id": "{resourceid}",
"resourceType": "Microsoft.Network/virtualNetworks/subnets",
"resourceName": "VNet1/Subnet1"
}
],
"id": "{resourceid}",
"resourceType": "Microsoft.Network/virtualNetworks/subnets",
"resourceName": "VNet1/Subnet2"
}
],
"onErrorDeployment": {
"type": "LastSuccessful",
"deploymentName": "{nameOfLastSuccesfulDeployment}"
}
}
}
要求のサンプル
PUT https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000001/resourcegroups/my-resource-group/providers/Microsoft.Resources/deployments/my-deployment?api-version=2025-04-01
{
"properties": {
"template": {
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"inputObj": {
"type": "object"
}
},
"resources": [],
"outputs": {
"inputObj": {
"type": "object",
"value": "[parameters('inputObj')]"
}
}
},
"parameters": {
"inputObj": {
"expression": "[createObject('foo', externalInputs('fooValue'))]"
}
},
"externalInputDefinitions": {
"fooValue": {
"kind": "sys.envVar",
"config": "FOO_VALUE"
}
},
"externalInputs": {
"fooValue": {
"value": "baz"
}
},
"mode": "Incremental"
}
}
import com.azure.core.management.serializer.SerializerFactory;
import com.azure.core.util.serializer.SerializerEncoding;
import com.azure.resourcemanager.resources.fluent.models.DeploymentInner;
import com.azure.resourcemanager.resources.models.DeploymentExternalInput;
import com.azure.resourcemanager.resources.models.DeploymentExternalInputDefinition;
import com.azure.resourcemanager.resources.models.DeploymentMode;
import com.azure.resourcemanager.resources.models.DeploymentParameter;
import com.azure.resourcemanager.resources.models.DeploymentProperties;
import java.io.IOException;
import java.util.HashMap;
import java.util.Map;
/**
* Samples for Deployments CreateOrUpdate.
*/
public final class Main {
/*
* x-ms-original-file:
* specification/resources/resource-manager/Microsoft.Resources/deployments/stable/2025-04-01/examples/
* PutDeploymentWithExternalInputs.json
*/
/**
* Sample code: Create deployment using external inputs.
*
* @param azure The entry point for accessing resource management APIs in Azure.
*/
public static void createDeploymentUsingExternalInputs(com.azure.resourcemanager.AzureResourceManager azure)
throws IOException {
azure.genericResources().manager().deploymentClient().getDeployments().createOrUpdate("my-resource-group",
"my-deployment",
new DeploymentInner().withProperties(new DeploymentProperties()
.withTemplate(SerializerFactory.createDefaultManagementSerializerAdapter().deserialize(
"{\"$schema\":\"https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#\",\"contentVersion\":\"1.0.0.0\",\"outputs\":{\"inputObj\":{\"type\":\"object\",\"value\":\"[parameters('inputObj')]\"}},\"parameters\":{\"inputObj\":{\"type\":\"object\"}},\"resources\":[]}",
Object.class, SerializerEncoding.JSON))
.withParameters(mapOf("inputObj",
new DeploymentParameter().withExpression("[createObject('foo', externalInputs('fooValue'))]")))
.withExternalInputs(mapOf("fooValue", new DeploymentExternalInput().withValue("baz")))
.withExternalInputDefinitions(mapOf("fooValue",
new DeploymentExternalInputDefinition().withKind("sys.envVar").withConfig("FOO_VALUE")))
.withMode(DeploymentMode.INCREMENTAL)),
com.azure.core.util.Context.NONE);
}
// Use "Map.of" if available
@SuppressWarnings("unchecked")
private static <T> Map<String, T> mapOf(Object... inputs) {
Map<String, T> map = new HashMap<>();
for (int i = 0; i < inputs.length; i += 2) {
String key = (String) inputs[i];
T value = (T) inputs[i + 1];
map.put(key, value);
}
return map;
}
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
from azure.identity import DefaultAzureCredential
from azure.mgmt.resource.deployments import DeploymentsMgmtClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-resource-deployments
# USAGE
python put_deployment_with_external_inputs.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
"""
def main():
client = DeploymentsMgmtClient(
credential=DefaultAzureCredential(),
subscription_id="00000000-0000-0000-0000-000000000001",
)
response = client.deployments.begin_create_or_update(
resource_group_name="my-resource-group",
deployment_name="my-deployment",
parameters={
"properties": {
"externalInputDefinitions": {"fooValue": {"config": "FOO_VALUE", "kind": "sys.envVar"}},
"externalInputs": {"fooValue": {"value": "baz"}},
"mode": "Incremental",
"parameters": {"inputObj": {"expression": "[createObject('foo', externalInputs('fooValue'))]"}},
"template": {
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"outputs": {"inputObj": {"type": "object", "value": "[parameters('inputObj')]"}},
"parameters": {"inputObj": {"type": "object"}},
"resources": [],
},
}
},
).result()
print(response)
# x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/deployments/stable/2025-04-01/examples/PutDeploymentWithExternalInputs.json
if __name__ == "__main__":
main()
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
package armdeployments_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resources/armdeployments"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/edacc3b43f9603efa119eabb6013d952d1dbe7d6/specification/resources/resource-manager/Microsoft.Resources/deployments/stable/2025-04-01/examples/PutDeploymentWithExternalInputs.json
func ExampleClient_BeginCreateOrUpdate_createDeploymentUsingExternalInputs() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armdeployments.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
poller, err := clientFactory.NewClient().BeginCreateOrUpdate(ctx, "my-resource-group", "my-deployment", armdeployments.Deployment{
Properties: &armdeployments.DeploymentProperties{
ExternalInputDefinitions: map[string]*armdeployments.DeploymentExternalInputDefinition{
"fooValue": {
Config: "FOO_VALUE",
Kind: to.Ptr("sys.envVar"),
},
},
ExternalInputs: map[string]*armdeployments.DeploymentExternalInput{
"fooValue": {
Value: "baz",
},
},
Mode: to.Ptr(armdeployments.DeploymentModeIncremental),
Parameters: map[string]*armdeployments.DeploymentParameter{
"inputObj": {
Expression: to.Ptr("[createObject('foo', externalInputs('fooValue'))]"),
},
},
Template: map[string]any{
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"outputs": map[string]any{
"inputObj": map[string]any{
"type": "object",
"value": "[parameters('inputObj')]",
},
},
"parameters": map[string]any{
"inputObj": map[string]any{
"type": "object",
},
},
"resources": []any{},
},
},
}, nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
res, err := poller.PollUntilDone(ctx, nil)
if err != nil {
log.Fatalf("failed to pull the result: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res.DeploymentExtended = armdeployments.DeploymentExtended{
// Name: to.Ptr("my-deployment"),
// Type: to.Ptr("Microsoft.Resources/deployments"),
// ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000001/resourceGroups/my-resource-group/providers/Microsoft.Resources/deployments/my-deployment"),
// Properties: &armdeployments.DeploymentPropertiesExtended{
// CorrelationID: to.Ptr("ef613b6c-f76e-48fd-9da7-28884243c5e5"),
// Dependencies: []*armdeployments.Dependency{
// },
// Mode: to.Ptr(armdeployments.DeploymentModeIncremental),
// OutputResources: []*armdeployments.ResourceReference{
// },
// Outputs: map[string]any{
// "inputObj":map[string]any{
// "type": "Object",
// "value":map[string]any{
// "foo": "baz",
// },
// },
// },
// Parameters: map[string]any{
// "inputObj":map[string]any{
// "type": "Object",
// "value":map[string]any{
// "foo": "baz",
// },
// },
// },
// Providers: []*armdeployments.Provider{
// },
// ProvisioningState: to.Ptr(armdeployments.ProvisioningStateSucceeded),
// TemplateHash: to.Ptr("17686481789412793580"),
// Timestamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2025-04-09T14:36:48.204Z"); return t}()),
// },
// }
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
const { DeploymentsClient } = require("@azure/arm-resourcesdeployments");
const { DefaultAzureCredential } = require("@azure/identity");
require("dotenv/config");
/**
* This sample demonstrates how to You can provide the template and parameters directly in the request or link to JSON files.
*
* @summary You can provide the template and parameters directly in the request or link to JSON files.
* x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/deployments/stable/2025-04-01/examples/PutDeploymentWithExternalInputs.json
*/
async function createDeploymentUsingExternalInputs() {
const subscriptionId =
process.env["RESOURCES_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000001";
const resourceGroupName = process.env["RESOURCES_RESOURCE_GROUP"] || "my-resource-group";
const deploymentName = "my-deployment";
const parameters = {
properties: {
externalInputDefinitions: {
fooValue: { config: "FOO_VALUE", kind: "sys.envVar" },
},
externalInputs: { fooValue: { value: "baz" } },
mode: "Incremental",
parameters: {
inputObj: {
expression: "[createObject('foo', externalInputs('fooValue'))]",
},
},
template: {
$schema: "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
contentVersion: "1.0.0.0",
outputs: {
inputObj: { type: "object", value: "[parameters('inputObj')]" },
},
parameters: { inputObj: { type: "object" } },
resources: [],
},
},
};
const credential = new DefaultAzureCredential();
const client = new DeploymentsClient(credential, subscriptionId);
const result = await client.deployments.beginCreateOrUpdateAndWait(
resourceGroupName,
deploymentName,
parameters,
);
console.log(result);
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
応答のサンプル
{
"id": "/subscriptions/00000000-0000-0000-0000-000000000001/resourceGroups/my-resource-group/providers/Microsoft.Resources/deployments/my-deployment",
"name": "my-deployment",
"type": "Microsoft.Resources/deployments",
"properties": {
"templateHash": "17686481789412793580",
"parameters": {
"inputObj": {
"type": "Object",
"value": {
"foo": "baz"
}
}
},
"mode": "Incremental",
"provisioningState": "Succeeded",
"timestamp": "2025-04-09T14:36:48.2047169Z",
"correlationId": "ef613b6c-f76e-48fd-9da7-28884243c5e5",
"providers": [],
"dependencies": [],
"outputs": {
"inputObj": {
"type": "Object",
"value": {
"foo": "baz"
}
}
},
"outputResources": []
}
}
{
"id": "/subscriptions/00000000-0000-0000-0000-000000000001/resourceGroups/my-resource-group/providers/Microsoft.Resources/deployments/my-deployment",
"name": "my-deployment",
"type": "Microsoft.Resources/deployments",
"properties": {
"templateHash": "17686481789412793580",
"parameters": {
"inputObj": {
"type": "Object",
"value": {
"foo": "baz"
}
}
},
"mode": "Incremental",
"provisioningState": "Accepted",
"timestamp": "2025-04-09T14:36:47.6637583Z",
"duration": "PT0.0009164S",
"correlationId": "ef613b6c-f76e-48fd-9da7-28884243c5e5",
"providers": [],
"dependencies": []
}
}
定義
Alias
Object
エイリアスの種類。
名前 |
型 |
説明 |
defaultMetadata
|
AliasPathMetadata
|
既定のエイリアス パスのメタデータ。 既定のパスと、メタデータを持たないエイリアス パスに適用されます
|
defaultPath
|
string
|
エイリアスの既定のパス。
|
defaultPattern
|
AliasPattern
|
エイリアスの既定のパターン。
|
name
|
string
|
エイリアス名。
|
paths
|
AliasPath[]
|
エイリアスのパス。
|
type
|
AliasType
|
エイリアスの型。
|
AliasPath
Object
エイリアスのパスの型。
名前 |
型 |
説明 |
apiVersions
|
string[]
|
API のバージョン。
|
metadata
|
AliasPathMetadata
|
エイリアス パスのメタデータ。 存在しない場合は、エイリアスの既定のメタデータにフォールバックします。
|
path
|
string
|
エイリアスのパス。
|
pattern
|
AliasPattern
|
エイリアス パスのパターン。
|
AliasPathAttributes
列挙
エイリアス パスが参照しているトークンの属性。
値 |
説明 |
None
|
エイリアス パスが参照しているトークンには属性がありません。
|
Modifiable
|
エイリアス パスが参照しているトークンは、'modify' 効果を持つポリシーによって変更できます。
|
Object
AliasPathTokenType
列挙
エイリアス パスが参照しているトークンの型。
値 |
説明 |
NotSpecified
|
トークンの種類が指定されていません。
|
Any
|
トークンの種類は何でもかまいません。
|
String
|
トークン型は文字列です。
|
Object
|
トークン型はオブジェクトです。
|
Array
|
トークン型は配列です。
|
Integer
|
トークン型は整数です。
|
Number
|
トークンの種類は数値です。
|
Boolean
|
トークンの種類はブール値です。
|
AliasPattern
Object
エイリアス パスのパターンの型。
名前 |
型 |
説明 |
phrase
|
string
|
エイリアス パターン フレーズ。
|
type
|
AliasPatternType
|
エイリアス パターンの種類
|
variable
|
string
|
エイリアス パターン変数。
|
AliasPatternType
列挙
エイリアス パターンの種類
値 |
説明 |
NotSpecified
|
NotSpecified は許可されていません。
|
Extract
|
抽出は、唯一の許容値です。
|
AliasType
列挙
エイリアスの型。
値 |
説明 |
NotSpecified
|
エイリアスの種類が不明です (エイリアス型を指定しない場合と同じです)。
|
PlainText
|
エイリアス値はシークレットではありません。
|
Mask
|
エイリアス値はシークレットです。
|
ApiProfile
Object
名前 |
型 |
説明 |
apiVersion
|
string
|
API のバージョン。
|
profileVersion
|
string
|
プロファイルのバージョン。
|
BasicDependency
Object
デプロイの依存関係情報。
名前 |
型 |
説明 |
id
|
string
|
依存関係の ID。
|
resourceName
|
string
|
依存関係リソース名。
|
resourceType
|
string
|
依存関係リソースの種類。
|
CloudError
Object
リソース管理要求のエラー応答。
名前 |
型 |
説明 |
error
|
ErrorResponse
|
エラー応答
失敗した操作のエラーの詳細を返す、すべての Azure Resource Manager API の一般的なエラー応答。 (これは、OData エラー応答形式にも従います)。
|
DebugSetting
Object
デバッグ設定。
名前 |
型 |
説明 |
detailLevel
|
string
|
デバッグのためにログに記録する情報の種類を指定します。 許可される値は none、requestContent、responseContent、または requestContent と responseContent の両方でコンマで区切られています。 既定値は none です。 この値を設定するときは、デプロイ時に渡す情報の種類を慎重に検討してください。 要求または応答に関する情報をログに記録することで、展開操作を通じて取得される機密データを公開する可能性があります。
|
Dependency
Object
デプロイの依存関係情報。
名前 |
型 |
説明 |
dependsOn
|
BasicDependency[]
|
依存関係の一覧。
|
id
|
string
|
依存関係の ID。
|
resourceName
|
string
|
依存関係リソース名。
|
resourceType
|
string
|
依存関係リソースの種類。
|
Deployment
Object
デプロイ操作のパラメーター。
DeploymentDiagnosticsDefinition
Object
名前 |
型 |
説明 |
additionalInfo
|
ErrorAdditionalInfo[]
|
エラーの追加情報。
|
code
|
string
|
エラー コード。
|
level
|
Level
|
追加の応答レベルを示します。
|
message
|
string
|
エラー メッセージ。
|
target
|
string
|
エラーターゲット。
|
DeploymentExtended
Object
デプロイ情報。
名前 |
型 |
説明 |
id
|
string
|
デプロイの ID。
|
location
|
string
|
デプロイの場所。
|
name
|
string
|
デプロイメントの名前。
|
properties
|
DeploymentPropertiesExtended
|
展開のプロパティ。
|
tags
|
object
|
デプロイ タグ
|
type
|
string
|
デプロイの種類。
|
DeploymentExtensionConfigItem
Object
DeploymentExtensionDefinition
Object
名前 |
型 |
説明 |
alias
|
string
|
デプロイメント・テンプレートで定義されている拡張機能の別名。
|
config
|
<string,
DeploymentExtensionConfigItem>
|
拡張機能の構成。
|
configId
|
string
|
拡張機能の構成 ID。 拡張機能内のデプロイ コントロール プレーンを一意に識別します。
|
name
|
string
|
拡張機能の名前。
|
version
|
string
|
拡張機能のバージョン。
|
DeploymentExternalInput
Object
パラメーター化のためのデプロイメント外部入力。
DeploymentExternalInputDefinition
Object
パラメーター化のためのデプロイメント外部入力定義。
名前 |
型 |
説明 |
config
|
|
外部入力の設定。
|
kind
|
string
|
外部入力の種類。
|
DeploymentIdentity
Object
デプロイのマネージド ID 構成。
DeploymentIdentityType
列挙
ID の種類。
DeploymentMode
列挙
リソースのデプロイに使用されるモード。 この値には、Incremental または Complete のいずれかを指定できます。 増分モードでは、テンプレートに含まれていない既存のリソースを削除せずにリソースがデプロイされます。 完全モードでは、リソースがデプロイされ、テンプレートに含まれていないリソース グループ内の既存のリソースが削除されます。 リソースを誤って削除する可能性があるため、完全モードを使用する場合は注意してください。
値 |
説明 |
Incremental
|
|
Complete
|
|
DeploymentParameter
Object
テンプレートのデプロイ パラメーター。
DeploymentProperties
Object
展開のプロパティ。
名前 |
型 |
説明 |
debugSetting
|
DebugSetting
|
デプロイのデバッグ設定。
|
expressionEvaluationOptions
|
ExpressionEvaluationOptions
|
親テンプレートのスコープ内でテンプレート式を評価するか、入れ子になったテンプレートを評価するかを指定します。 入れ子になったテンプレートにのみ適用されます。 指定しない場合、既定値は outer です。
|
extensionConfigs
|
object
|
デプロイ拡張機能に使用する構成。 このオブジェクトのキーは、デプロイ テンプレートで定義されているデプロイ拡張機能のエイリアスです。
|
externalInputDefinitions
|
<string,
DeploymentExternalInputDefinition>
|
外部入力定義は、外部ツールが期待される外部入力値を定義するために使用されます。
|
externalInputs
|
<string,
DeploymentExternalInput>
|
外部入力値は、パラメータ評価のために外部ツールによって使用されます。
|
mode
|
DeploymentMode
|
リソースのデプロイに使用されるモード。 この値には、Incremental または Complete のいずれかを指定できます。 増分モードでは、テンプレートに含まれていない既存のリソースを削除せずにリソースがデプロイされます。 完全モードでは、リソースがデプロイされ、テンプレートに含まれていないリソース グループ内の既存のリソースが削除されます。 リソースを誤って削除する可能性があるため、完全モードを使用する場合は注意してください。
|
onErrorDeployment
|
OnErrorDeployment
|
エラー動作でのデプロイ。
|
parameters
|
<string,
DeploymentParameter>
|
テンプレートのデプロイ パラメーターを定義する名前と値のペア。 この要素は、既存のパラメーター ファイルへのリンクではなく、要求でパラメーター値を直接指定する場合に使用します。 parametersLink プロパティまたは parameters プロパティを使用しますが、両方を使用することはできません。 JObject または整形式の JSON 文字列を指定できます。
|
parametersLink
|
ParametersLink
|
パラメーター ファイルの URI。 この要素を使用して、既存のパラメーター ファイルにリンクします。 parametersLink プロパティまたは parameters プロパティを使用しますが、両方を使用することはできません。
|
template
|
object
|
テンプレートの内容。 この要素は、既存のテンプレートへのリンクではなく、要求でテンプレート構文を直接渡す場合に使用します。 JObject または整形式の JSON 文字列を指定できます。 templateLink プロパティまたは template プロパティを使用しますが、両方は使用しないでください。
|
templateLink
|
TemplateLink
|
テンプレートの URI。 templateLink プロパティまたは template プロパティを使用しますが、両方は使用しないでください。
|
validationLevel
|
ValidationLevel
|
デプロイの検証レベル
|
DeploymentPropertiesExtended
Object
追加の詳細を含む展開プロパティ。
ErrorAdditionalInfo
Object
リソース管理エラーの追加情報。
名前 |
型 |
説明 |
info
|
object
|
追加情報。
|
type
|
string
|
追加情報の種類。
|
ErrorResponse
Object
エラー応答
ExpressionEvaluationOptions
Object
親テンプレートのスコープ内でテンプレート式を評価するか、入れ子になったテンプレートを評価するかを指定します。
ExpressionEvaluationOptionsScopeType
列挙
入れ子になったテンプレート内のパラメーター、変数、関数の評価に使用するスコープ。
値 |
説明 |
NotSpecified
|
|
Outer
|
|
Inner
|
|
ExtensionConfigPropertyType
列挙
値 |
説明 |
String
|
文字列値を表すプロパティの型。
|
Int
|
整数値を表すプロパティの型。
|
Bool
|
ブール値を表すプロパティの型。
|
Array
|
配列値を表すプロパティの型。
|
Object
|
オブジェクト値を表すプロパティの型。
|
SecureString
|
セキュリティで保護された文字列値を表すプロパティの種類。
|
SecureObject
|
セキュア・オブジェクト値を表すプロパティ・タイプ。
|
KeyVaultParameterReference
Object
Azure Key Vault パラメーターリファレンス。
名前 |
型 |
説明 |
keyVault
|
KeyVaultReference
|
Azure Key Vault リファレンス。
|
secretName
|
string
|
Azure Key Vault シークレット名。
|
secretVersion
|
string
|
Azure Key Vault シークレットのバージョン。
|
KeyVaultReference
Object
Azure Key Vault リファレンス。
名前 |
型 |
説明 |
id
|
string
|
Azure Key Vault リソース ID。
|
Level
列挙
追加の応答レベルを示します。
OnErrorDeployment
Object
エラー動作でのデプロイ。
名前 |
型 |
説明 |
deploymentName
|
string
|
エラー ケースで使用するデプロイ。
|
type
|
OnErrorDeploymentType
|
エラー動作の種類でのデプロイ。 指定できる値は LastSuccessful と SpecificDeployment です。
|
OnErrorDeploymentExtended
Object
追加の詳細を含むエラー動作でのデプロイ。
名前 |
型 |
説明 |
deploymentName
|
string
|
エラー ケースで使用するデプロイ。
|
provisioningState
|
string
|
エラー時のデプロイのプロビジョニングの状態。
|
type
|
OnErrorDeploymentType
|
エラー動作の種類でのデプロイ。 指定できる値は LastSuccessful と SpecificDeployment です。
|
OnErrorDeploymentType
列挙
エラー動作の種類でのデプロイ。 指定できる値は LastSuccessful と SpecificDeployment です。
値 |
説明 |
LastSuccessful
|
|
SpecificDeployment
|
|
ParametersLink
Object
デプロイ パラメーターへの参照を表すエンティティ。
名前 |
型 |
説明 |
contentVersion
|
string
|
含まれている場合は、テンプレートの ContentVersion と一致する必要があります。
|
uri
|
string
|
パラメーター ファイルの URI。
|
Provider
Object
リソース プロバイダー情報。
名前 |
型 |
説明 |
id
|
string
|
プロバイダー ID。
|
namespace
|
string
|
リソース プロバイダーの名前空間。
|
providerAuthorizationConsentState
|
ProviderAuthorizationConsentState
|
プロバイダー承認の同意の状態。
|
registrationPolicy
|
string
|
リソース プロバイダーの登録ポリシー。
|
registrationState
|
string
|
リソース プロバイダーの登録状態。
|
resourceTypes
|
ProviderResourceType[]
|
プロバイダー リソースの種類のコレクション。
|
ProviderAuthorizationConsentState
列挙
プロバイダー承認の同意の状態。
値 |
説明 |
NotSpecified
|
|
Required
|
|
NotRequired
|
|
Consented
|
|
ProviderExtendedLocation
Object
プロバイダーの拡張場所。
名前 |
型 |
説明 |
extendedLocations
|
string[]
|
Azure の場所の拡張された場所。
|
location
|
string
|
Azure の場所。
|
type
|
string
|
拡張された場所の種類。
|
ProviderResourceType
Object
リソース プロバイダーによって管理されるリソースの種類。
名前 |
型 |
説明 |
aliases
|
Alias[]
|
このリソースの種類でサポートされるエイリアス。
|
apiProfiles
|
ApiProfile[]
|
リソース プロバイダーの API プロファイル。
|
apiVersions
|
string[]
|
API のバージョン。
|
capabilities
|
string
|
このリソースの種類によって提供される追加の機能。
|
defaultApiVersion
|
string
|
既定の API バージョン。
|
locationMappings
|
ProviderExtendedLocation[]
|
このリソースの種類でサポートされている場所マッピング。
|
locations
|
string[]
|
このリソースの種類を作成できる場所のコレクション。
|
properties
|
object
|
プロパティ。
|
resourceType
|
string
|
リソースの種類。
|
zoneMappings
|
ZoneMapping[]
|
|
ProvisioningState
列挙
プロビジョニングの状態を示します。
値 |
説明 |
NotSpecified
|
|
Accepted
|
|
Running
|
|
Ready
|
|
Creating
|
|
Created
|
|
Deleting
|
|
Deleted
|
|
Canceled
|
|
Failed
|
|
Succeeded
|
|
Updating
|
|
ResourceReference
Object
リソース ID モデル。
名前 |
型 |
説明 |
apiVersion
|
string
|
リソースがデプロイされた API バージョン。
|
extension
|
DeploymentExtensionDefinition
|
リソースがデプロイされた拡張機能。
|
id
|
string
|
完全修飾 Azure リソース ID。
|
identifiers
|
object
|
拡張可能なリソース識別子。
|
resourceType
|
string
|
リソースの種類。
|
TemplateLink
Object
テンプレートへの参照を表すエンティティ。
名前 |
型 |
説明 |
contentVersion
|
string
|
含まれている場合は、テンプレートの ContentVersion と一致する必要があります。
|
id
|
string
|
テンプレート スペックのリソース ID。id または uri プロパティを使用しますが、両方は使用しないでください。
|
queryString
|
string
|
templateLink URI で使用するクエリ文字列 (SAS トークンなど)。
|
relativePath
|
string
|
relativePath プロパティを使用すると、親に対する相対位置にリンクされたテンプレートを配置できます。 親テンプレートが TemplateSpec にリンクされている場合、TemplateSpec 内の成果物が参照されます。 親が URI にリンクされている場合、子デプロイは親 URI と relativePath URI の組み合わせになります。
|
uri
|
string
|
デプロイするテンプレートの URI。 uri または id プロパティを使用しますが、両方は使用しないでください。
|
UserAssignedIdentity
Object
ユーザー割り当て ID プロパティ
名前 |
型 |
説明 |
clientId
|
string
(uuid)
|
割り当てられた ID のクライアント ID。
|
principalId
|
string
(uuid)
|
割り当てられた ID のプリンシパル ID。
|
ValidationLevel
列挙
デプロイメントで実行される検証のレベル。
値 |
説明 |
Template
|
テンプレートの静的解析が実行されます。
|
Provider
|
テンプレートの静的分析が実行され、セマンティック検証のためにリソース宣言がリソース プロバイダーに送信されます。 呼び出し元が各リソースに対する RBAC 書き込みアクセス許可を持っていることを検証します。
|
ProviderNoRbac
|
テンプレートの静的分析が実行され、セマンティック検証のためにリソース宣言がリソース プロバイダーに送信されます。 呼び出し元が各リソースに対する RBAC 書き込みアクセス許可を持っているかどうかの検証をスキップします。
|
ZoneMapping
Object
名前 |
型 |
説明 |
location
|
string
|
ゾーン マッピングの場所。
|
zones
|
string[]
|
|