Dela via


Artifacts - Create Or Update

Skapa eller uppdatera skissartefakten.

PUT https://management.azure.com/{resourceScope}/providers/Microsoft.Blueprint/blueprints/{blueprintName}/artifacts/{artifactName}?api-version=2018-11-01-preview

URI-parametrar

Name I Obligatorisk Typ Description
artifactName
path True

string

Namnet på skissartefakten.

blueprintName
path True

string

Namnet på skissdefinitionen.

resourceScope
path True

string

Resursens omfång. Giltiga omfång är: hanteringsgrupp (format: '/providers/Microsoft.Management/managementGroups/{managementGroup}'), prenumeration (format: '/subscriptions/{subscriptionId}').

api-version
query True

string

Klient-API-version.

Begärandetext

Brödtexten i begäran kan vara något av följande:

Name Description
PolicyAssignmentArtifact

Skissartefakt som tillämpar en principtilldelning.

RoleAssignmentArtifact

Skissartefakt som tillämpar en rolltilldelning.

TemplateArtifact

Skissartefakt som distribuerar en Resource Manager-mall.

PolicyAssignmentArtifact

Skissartefakt som tillämpar en principtilldelning.

Name Obligatorisk Typ Description
kind True string:

policyAssignment

Anger typen av skissartefakt.

properties.parameters True

<string,  ParameterValue>

Parametervärden för principdefinitionen.

properties.policyDefinitionId True

string

Azure-resurs-ID för principdefinitionen.

properties.dependsOn

string[]

Artefakter som måste distribueras före den angivna artefakten.

properties.description

string

maxLength: 500

Förklara den här resursen med flera rader.

properties.displayName

string

maxLength: 256

Enradssträng förklarar den här resursen.

properties.resourceGroup

string

Namn på platshållaren för resursgruppen som principen ska tilldelas till.

RoleAssignmentArtifact

Skissartefakt som tillämpar en rolltilldelning.

Name Obligatorisk Typ Description
kind True string:

roleAssignment

Anger typen av skissartefakt.

properties.principalIds True

Matris med användar- eller gruppidentiteter i Azure Active Directory. RoleDefinition gäller för varje identitet.

properties.roleDefinitionId True

string

Azure-resurs-ID för RoleDefinition.

properties.dependsOn

string[]

Artefakter som måste distribueras före den angivna artefakten.

properties.description

string

maxLength: 500

Förklara den här resursen med flera rader.

properties.displayName

string

maxLength: 256

Enradssträng förklarar den här resursen.

properties.resourceGroup

string

RoleAssignment kommer att vara omfång för den här resourceGroup. Om den är tom omfångsbegränsas den till prenumerationen.

TemplateArtifact

Skissartefakt som distribuerar en Resource Manager-mall.

Name Obligatorisk Typ Description
kind True string:

template

Anger typen av skissartefakt.

properties.parameters True

<string,  ParameterValue>

Resource Manager-mallens parametervärden för skissartefakter.

properties.template True

object

Resource Manager-mallens artefakttext för skissen.

properties.dependsOn

string[]

Artefakter som måste distribueras före den angivna artefakten.

properties.description

string

maxLength: 500

Förklara den här resursen med flera rader.

properties.displayName

string

maxLength: 256

Enradssträng förklarar den här resursen.

properties.resourceGroup

string

Om tillämpligt, namnet på platshållaren för resursgruppen som Resource Manager-mallens skissartefakt ska distribueras till.

Svar

Name Typ Description
201 Created Artifact:

Skapad – skissartefakt skapad/uppdaterad.

Other Status Codes

CloudError

Felsvar för skisser.

Säkerhet

azure_auth

Azure Active Directory OAuth2 Flow

Typ: oauth2
Flow: implicit
Auktoriseringswebbadress: https://login.microsoftonline.com/common/oauth2/authorize

Omfattningar

Name Description
user_impersonation personifiera ditt användarkonto

Exempel

MG-ARMTemplateArtifact
MG-PolicyAssignmentArtifact
MG-RoleAssignmentArtifact
Sub-ARMTemplateArtifact
Sub-PolicyAssignmentArtifact
Sub-RoleAssignmentArtifact

MG-ARMTemplateArtifact

Exempelbegäran

PUT https://management.azure.com/providers/Microsoft.Management/managementGroups/ContosoOnlineGroup/providers/Microsoft.Blueprint/blueprints/simpleBlueprint/artifacts/storageTemplate?api-version=2018-11-01-preview

{
  "kind": "template",
  "properties": {
    "template": {
      "contentVersion": "1.0.0.0",
      "parameters": {
        "storageAccountType": {
          "type": "string",
          "defaultValue": "Standard_LRS",
          "allowedValues": [
            "Standard_LRS",
            "Standard_GRS",
            "Standard_ZRS",
            "Premium_LRS"
          ],
          "metadata": {
            "description": "Storage Account type"
          }
        }
      },
      "variables": {
        "storageAccountName": "[concat(uniquestring(resourceGroup().id), 'standardsa')]"
      },
      "resources": [
        {
          "type": "Microsoft.Storage/storageAccounts",
          "name": "[variables('storageAccountName')]",
          "apiVersion": "2016-01-01",
          "location": "[resourceGroup().location]",
          "sku": {
            "name": "[parameters('storageAccountType')]"
          },
          "kind": "Storage",
          "properties": {}
        }
      ],
      "outputs": {
        "storageAccountName": {
          "type": "string",
          "value": "[variables('storageAccountName')]"
        }
      }
    },
    "resourceGroup": "storageRG",
    "parameters": {
      "storageAccountType": {
        "value": "[parameters('storageAccountType')]"
      }
    }
  }
}

Exempelsvar

{
  "properties": {
    "template": {
      "contentVersion": "1.0.0.0",
      "parameters": {
        "storageAccountType": {
          "type": "string",
          "defaultValue": "Standard_LRS",
          "allowedValues": [
            "Standard_LRS",
            "Standard_GRS",
            "Standard_ZRS",
            "Premium_LRS"
          ],
          "metadata": {
            "description": "Storage Account type"
          }
        }
      },
      "variables": {
        "storageAccountName": "[concat(uniquestring(resourceGroup().id), 'standardsa')]"
      },
      "resources": [
        {
          "type": "Microsoft.Storage/storageAccounts",
          "name": "[variables('storageAccountName')]",
          "apiVersion": "2016-01-01",
          "location": "[resourceGroup().location]",
          "sku": {
            "name": "[parameters('storageAccountType')]"
          },
          "kind": "Storage",
          "properties": {}
        }
      ],
      "outputs": {
        "storageAccountName": {
          "type": "string",
          "value": "[variables('storageAccountName')]"
        }
      }
    },
    "resourceGroup": "storageRG",
    "parameters": {
      "storageAccountType": {
        "value": "[parameters('storageAccountType')]"
      }
    }
  },
  "kind": "template",
  "id": "/providers/Microsoft.Management/managementGroups/ContosoOnlineGroup/providers/Microsoft.Blueprint/blueprints/simpleBlueprint/artifacts/storageTemplate",
  "type": "Microsoft.Blueprint/blueprints/artifacts",
  "name": "storageTemplate"
}

MG-PolicyAssignmentArtifact

Exempelbegäran

PUT https://management.azure.com/providers/Microsoft.Management/managementGroups/ContosoOnlineGroup/providers/Microsoft.Blueprint/blueprints/simpleBlueprint/artifacts/costCenterPolicy?api-version=2018-11-01-preview

{
  "properties": {
    "displayName": "force costCenter tag on all resources",
    "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/1e30110a-5ceb-460c-a204-c1c3969c6d62",
    "parameters": {
      "tagName": {
        "value": "costCenter"
      },
      "tagValue": {
        "value": "[parameter('costCenter')]"
      }
    }
  },
  "kind": "policyAssignment"
}

Exempelsvar

{
  "properties": {
    "displayName": "force costCenter tag on all resources",
    "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/1e30110a-5ceb-460c-a204-c1c3969c6d62",
    "parameters": {
      "tagName": {
        "value": "costCenter"
      },
      "tagValue": {
        "value": "[parameter('costCenter')]"
      }
    }
  },
  "kind": "policyAssignment",
  "id": "/providers/Microsoft.Management/managementGroups/ContosoOnlineGroup/providers/Microsoft.Blueprint/blueprints/simpleBlueprint/artifacts/costCenterPolicy",
  "type": "Microsoft.Blueprint/blueprints/artifacts",
  "name": "costCenterPolicy"
}

MG-RoleAssignmentArtifact

Exempelbegäran

PUT https://management.azure.com/providers/Microsoft.Management/managementGroups/ContosoOnlineGroup/providers/Microsoft.Blueprint/blueprints/simpleBlueprint/artifacts/ownerAssignment?api-version=2018-11-01-preview

{
  "properties": {
    "displayName": "enforce owners of given subscription",
    "roleDefinitionId": "/providers/Microsoft.Authorization/roleDefinitions/acdd72a7-3385-48ef-bd42-f606fba81ae7",
    "principalIds": "[parameters('owners')]"
  },
  "kind": "roleAssignment"
}

Exempelsvar

{
  "properties": {
    "displayName": "enforce owners of given subscription",
    "roleDefinitionId": "/providers/Microsoft.Authorization/roleDefinitions/acdd72a7-3385-48ef-bd42-f606fba81ae7",
    "principalIds": "[parameters('owners')]"
  },
  "kind": "roleAssignment",
  "id": "/providers/Microsoft.Management/managementGroups/ContosoOnlineGroup/providers/Microsoft.Blueprint/blueprints/simpleBlueprint/artifacts/ownerAssignment",
  "type": "Microsoft.Blueprint/blueprints/artifacts",
  "name": "ownerAssignment"
}

Sub-ARMTemplateArtifact

Exempelbegäran

PUT https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Blueprint/blueprints/simpleBlueprint/artifacts/storageTemplate?api-version=2018-11-01-preview

{
  "kind": "template",
  "properties": {
    "template": {
      "contentVersion": "1.0.0.0",
      "parameters": {
        "storageAccountType": {
          "type": "string",
          "defaultValue": "Standard_LRS",
          "allowedValues": [
            "Standard_LRS",
            "Standard_GRS",
            "Standard_ZRS",
            "Premium_LRS"
          ],
          "metadata": {
            "description": "Storage Account type"
          }
        }
      },
      "variables": {
        "storageAccountName": "[concat(uniquestring(resourceGroup().id), 'standardsa')]"
      },
      "resources": [
        {
          "type": "Microsoft.Storage/storageAccounts",
          "name": "[variables('storageAccountName')]",
          "apiVersion": "2016-01-01",
          "location": "[resourceGroup().location]",
          "sku": {
            "name": "[parameters('storageAccountType')]"
          },
          "kind": "Storage",
          "properties": {}
        }
      ],
      "outputs": {
        "storageAccountName": {
          "type": "string",
          "value": "[variables('storageAccountName')]"
        }
      }
    },
    "resourceGroup": "storageRG",
    "parameters": {
      "storageAccountType": {
        "value": "[parameters('storageAccountType')]"
      }
    }
  }
}

Exempelsvar

{
  "properties": {
    "template": {
      "contentVersion": "1.0.0.0",
      "parameters": {
        "storageAccountType": {
          "type": "string",
          "defaultValue": "Standard_LRS",
          "allowedValues": [
            "Standard_LRS",
            "Standard_GRS",
            "Standard_ZRS",
            "Premium_LRS"
          ],
          "metadata": {
            "description": "Storage Account type"
          }
        }
      },
      "variables": {
        "storageAccountName": "[concat(uniquestring(resourceGroup().id), 'standardsa')]"
      },
      "resources": [
        {
          "type": "Microsoft.Storage/storageAccounts",
          "name": "[variables('storageAccountName')]",
          "apiVersion": "2016-01-01",
          "location": "[resourceGroup().location]",
          "sku": {
            "name": "[parameters('storageAccountType')]"
          },
          "kind": "Storage",
          "properties": {}
        }
      ],
      "outputs": {
        "storageAccountName": {
          "type": "string",
          "value": "[variables('storageAccountName')]"
        }
      }
    },
    "resourceGroup": "storageRG",
    "parameters": {
      "storageAccountType": {
        "value": "[parameters('storageAccountType')]"
      }
    }
  },
  "kind": "template",
  "id": "/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Blueprint/blueprints/simpleBlueprint/artifacts/storageTemplate",
  "type": "Microsoft.Blueprint/blueprints/artifacts",
  "name": "storageTemplate"
}

Sub-PolicyAssignmentArtifact

Exempelbegäran

PUT https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Blueprint/blueprints/simpleBlueprint/artifacts/costCenterPolicy?api-version=2018-11-01-preview

{
  "properties": {
    "displayName": "force costCenter tag on all resources",
    "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/1e30110a-5ceb-460c-a204-c1c3969c6d62",
    "parameters": {
      "tagName": {
        "value": "costCenter"
      },
      "tagValue": {
        "value": "[parameter('costCenter')]"
      }
    }
  },
  "kind": "policyAssignment"
}

Exempelsvar

{
  "properties": {
    "displayName": "force costCenter tag on all resources",
    "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/1e30110a-5ceb-460c-a204-c1c3969c6d62",
    "parameters": {
      "tagName": {
        "value": "costCenter"
      },
      "tagValue": {
        "value": "[parameter('costCenter')]"
      }
    }
  },
  "kind": "policyAssignment",
  "id": "/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Blueprint/blueprints/simpleBlueprint/artifacts/costCenterPolicy",
  "type": "Microsoft.Blueprint/blueprints/artifacts",
  "name": "costCenterPolicy"
}

Sub-RoleAssignmentArtifact

Exempelbegäran

PUT https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Blueprint/blueprints/simpleBlueprint/artifacts/ownerAssignment?api-version=2018-11-01-preview

{
  "properties": {
    "displayName": "enforce owners of given subscription",
    "roleDefinitionId": "/providers/Microsoft.Authorization/roleDefinitions/acdd72a7-3385-48ef-bd42-f606fba81ae7",
    "principalIds": "[parameters('owners')]"
  },
  "kind": "roleAssignment"
}

Exempelsvar

{
  "properties": {
    "displayName": "enforce owners of given subscription",
    "roleDefinitionId": "/providers/Microsoft.Authorization/roleDefinitions/acdd72a7-3385-48ef-bd42-f606fba81ae7",
    "principalIds": "[parameters('owners')]"
  },
  "kind": "roleAssignment",
  "id": "/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Blueprint/blueprints/simpleBlueprint/artifacts/ownerAssignment",
  "type": "Microsoft.Blueprint/blueprints/artifacts",
  "name": "ownerAssignment"
}

Definitioner

Name Description
CloudError
ErrorAdditionalInfo

Ytterligare information om resurshanteringsfelet.

ErrorResponse

Felsvar

keyVaultReference

Anger länken till ett Nyckelvalv.

ParameterValue

Värde för den angivna parametern. Kan vara antingen "värde" eller "referens", men inte båda.

PolicyAssignmentArtifact

Skissartefakt som tillämpar en principtilldelning.

RoleAssignmentArtifact

Skissartefakt som tillämpar en rolltilldelning.

SecretValueReference

Referens till en Key Vault-hemlighet.

TemplateArtifact

Skissartefakt som distribuerar en Resource Manager-mall.

CloudError

Name Typ Description
error

ErrorResponse

Felsvar
Vanligt felsvar för alla Azure Resource Manager-API:er för att returnera felinformation för misslyckade åtgärder. (Detta följer även formatet för OData-felsvar.)

ErrorAdditionalInfo

Ytterligare information om resurshanteringsfelet.

Name Typ Description
info

object

Ytterligare information.

type

string

Ytterligare informationstyp.

ErrorResponse

Felsvar

Name Typ Description
additionalInfo

ErrorAdditionalInfo[]

Ytterligare information om felet.

code

string

Felkoden.

details

ErrorResponse[]

Felinformationen.

message

string

Felmeddelandet.

target

string

Felmålet.

keyVaultReference

Anger länken till ett Nyckelvalv.

Name Typ Description
id

string

Azure-resurs-ID för Key Vault.

ParameterValue

Värde för den angivna parametern. Kan vara antingen "värde" eller "referens", men inte båda.

Name Typ Description
reference

SecretValueReference

Parametervärde som referenstyp.

value

object

Parametervärde. Alla giltiga JSON-värden tillåts, inklusive objekt, matriser, strängar, tal och booleska värden.

PolicyAssignmentArtifact

Skissartefakt som tillämpar en principtilldelning.

Name Typ Description
id

string

Sträng-ID som används för att hitta en resurs i Azure.

kind string:

policyAssignment

Anger typen av skissartefakt.

name

string

Namnet på den här resursen.

properties.dependsOn

string[]

Artefakter som måste distribueras före den angivna artefakten.

properties.description

string

maxLength: 500

Förklara den här resursen med flera rader.

properties.displayName

string

maxLength: 256

Enradssträng förklarar den här resursen.

properties.parameters

<string,  ParameterValue>

Parametervärden för principdefinitionen.

properties.policyDefinitionId

string

Azure-resurs-ID för principdefinitionen.

properties.resourceGroup

string

Namn på platshållaren för resursgruppen som principen ska tilldelas till.

type

string

Typ av resurs.

RoleAssignmentArtifact

Skissartefakt som tillämpar en rolltilldelning.

Name Typ Description
id

string

Sträng-ID som används för att hitta en resurs i Azure.

kind string:

roleAssignment

Anger typen av skissartefakt.

name

string

Namnet på den här resursen.

properties.dependsOn

string[]

Artefakter som måste distribueras före den angivna artefakten.

properties.description

string

maxLength: 500

Förklara den här resursen med flera rader.

properties.displayName

string

maxLength: 256

Enradssträng förklarar den här resursen.

properties.principalIds

Matris med användar- eller gruppidentiteter i Azure Active Directory. RoleDefinition gäller för varje identitet.

properties.resourceGroup

string

RoleAssignment kommer att vara omfång för den här resourceGroup. Om den är tom omfångsbegränsas den till prenumerationen.

properties.roleDefinitionId

string

Azure-resurs-ID för RoleDefinition.

type

string

Typ av resurs.

SecretValueReference

Referens till en Key Vault-hemlighet.

Name Typ Description
keyVault

keyVaultReference

Anger referensen till ett visst Azure Key Vault.

secretName

string

Namnet på hemligheten.

secretVersion

string

Den version av hemligheten som ska användas. Om den lämnas tom används den senaste versionen av hemligheten.

TemplateArtifact

Skissartefakt som distribuerar en Resource Manager-mall.

Name Typ Description
id

string

Sträng-ID som används för att hitta en resurs i Azure.

kind string:

template

Anger typen av skissartefakt.

name

string

Namnet på den här resursen.

properties.dependsOn

string[]

Artefakter som måste distribueras före den angivna artefakten.

properties.description

string

maxLength: 500

Förklara den här resursen med flera rader.

properties.displayName

string

maxLength: 256

Enradssträng förklarar den här resursen.

properties.parameters

<string,  ParameterValue>

Resource Manager-mallens parametervärden för skissartefakter.

properties.resourceGroup

string

Om tillämpligt, namnet på platshållaren för resursgruppen som Resource Manager-mallens skissartefakt ska distribueras till.

properties.template

object

Resource Manager-mallens artefakttext för skissen.

type

string

Typ av resurs.