Create or update a Maps Account. A Maps Account holds the keys which allow access to the Maps REST APIs.
PUT https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Maps/accounts/{accountName}?api-version=2023-06-01
URI Parameters
Name |
In |
Required |
Type |
Description |
accountName
|
path |
True
|
string
|
The name of the Maps Account.
|
resourceGroupName
|
path |
True
|
string
|
The name of the resource group. The name is case insensitive.
|
subscriptionId
|
path |
True
|
string
|
The ID of the target subscription.
|
api-version
|
query |
True
|
string
|
The API version to use for this operation.
|
Request Body
Name |
Required |
Type |
Description |
location
|
True
|
string
|
The geo-location where the resource lives
|
sku
|
True
|
Sku
|
The SKU of this account.
|
identity
|
|
ManagedServiceIdentity
|
Managed service identity (system assigned and/or user assigned identities)
|
kind
|
|
kind
|
Get or Set Kind property.
|
properties
|
|
MapsAccountProperties
|
The map account properties.
|
tags
|
|
object
|
Resource tags.
|
Responses
Name |
Type |
Description |
200 OK
|
MapsAccount
|
The Account was successfully updated.
|
201 Created
|
MapsAccount
|
The Account was successfully created.
|
Other Status Codes
|
ErrorResponse
|
An error occurred during creating or updating the Account.
|
Security
azure_auth
Azure Active Directory OAuth2 Flow
Type:
oauth2
Flow:
implicit
Authorization URL:
https://login.microsoftonline.com/common/oauth2/authorize
Scopes
Name |
Description |
user_impersonation
|
impersonate your user account
|
Examples
Create Account with Encryption
Sample request
PUT https://management.azure.com/subscriptions/21a9967a-e8a9-4656-a70b-96ff1c4d05a0/resourceGroups/myResourceGroup/providers/Microsoft.Maps/accounts/myMapsAccount?api-version=2023-06-01
{
"location": "eastus",
"sku": {
"name": "G2"
},
"kind": "Gen2",
"identity": {
"type": "UserAssigned",
"userAssignedIdentities": {
"/subscriptions/21a9967a-e8a9-4656-a70b-96ff1c4d05a0/resourceGroups/myResourceGroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identityName": {}
}
},
"properties": {
"encryption": {
"customerManagedKeyEncryption": {
"keyEncryptionKeyIdentity": {
"identityType": "userAssignedIdentity",
"userAssignedIdentityResourceId": "/subscriptions/21a9967a-e8a9-4656-a70b-96ff1c4d05a0/resourceGroups/myResourceGroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identityName"
},
"keyEncryptionKeyUrl": "https://contosovault.vault.azure.net/keys/contosokek"
}
}
}
}
import com.azure.resourcemanager.maps.fluent.models.MapsAccountProperties;
import com.azure.resourcemanager.maps.models.CustomerManagedKeyEncryption;
import com.azure.resourcemanager.maps.models.CustomerManagedKeyEncryptionKeyIdentity;
import com.azure.resourcemanager.maps.models.Encryption;
import com.azure.resourcemanager.maps.models.IdentityType;
import com.azure.resourcemanager.maps.models.Kind;
import com.azure.resourcemanager.maps.models.ManagedServiceIdentity;
import com.azure.resourcemanager.maps.models.ManagedServiceIdentityType;
import com.azure.resourcemanager.maps.models.Name;
import com.azure.resourcemanager.maps.models.Sku;
import com.azure.resourcemanager.maps.models.UserAssignedIdentity;
import java.util.HashMap;
import java.util.Map;
/**
* Samples for Accounts CreateOrUpdate.
*/
public final class Main {
/*
* x-ms-original-file:
* specification/maps/resource-manager/Microsoft.Maps/stable/2023-06-01/examples/CreateAccountEncryption.json
*/
/**
* Sample code: Create Account with Encryption.
*
* @param manager Entry point to AzureMapsManager.
*/
public static void createAccountWithEncryption(com.azure.resourcemanager.maps.AzureMapsManager manager) {
manager.accounts().define("myMapsAccount").withRegion("eastus").withExistingResourceGroup("myResourceGroup")
.withSku(new Sku().withName(Name.G2)).withKind(Kind.GEN2)
.withIdentity(new ManagedServiceIdentity().withType(ManagedServiceIdentityType.USER_ASSIGNED)
.withUserAssignedIdentities(mapOf(
"/subscriptions/21a9967a-e8a9-4656-a70b-96ff1c4d05a0/resourceGroups/myResourceGroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identityName",
new UserAssignedIdentity())))
.withProperties(new MapsAccountProperties()
.withEncryption(new Encryption().withCustomerManagedKeyEncryption(new CustomerManagedKeyEncryption()
.withKeyEncryptionKeyIdentity(new CustomerManagedKeyEncryptionKeyIdentity()
.withIdentityType(IdentityType.USER_ASSIGNED_IDENTITY).withUserAssignedIdentityResourceId(
"/subscriptions/21a9967a-e8a9-4656-a70b-96ff1c4d05a0/resourceGroups/myResourceGroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identityName"))
.withKeyEncryptionKeyUrl("fakeTokenPlaceholder"))))
.create();
}
// 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.maps import AzureMapsManagementClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-maps
# USAGE
python create_account_encryption.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 = AzureMapsManagementClient(
credential=DefaultAzureCredential(),
subscription_id="21a9967a-e8a9-4656-a70b-96ff1c4d05a0",
)
response = client.accounts.create_or_update(
resource_group_name="myResourceGroup",
account_name="myMapsAccount",
maps_account={
"identity": {
"type": "UserAssigned",
"userAssignedIdentities": {
"/subscriptions/21a9967a-e8a9-4656-a70b-96ff1c4d05a0/resourceGroups/myResourceGroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identityName": {}
},
},
"kind": "Gen2",
"location": "eastus",
"properties": {
"encryption": {
"customerManagedKeyEncryption": {
"keyEncryptionKeyIdentity": {
"identityType": "userAssignedIdentity",
"userAssignedIdentityResourceId": "/subscriptions/21a9967a-e8a9-4656-a70b-96ff1c4d05a0/resourceGroups/myResourceGroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identityName",
},
"keyEncryptionKeyUrl": "https://contosovault.vault.azure.net/keys/contosokek",
}
}
},
"sku": {"name": "G2"},
},
)
print(response)
# x-ms-original-file: specification/maps/resource-manager/Microsoft.Maps/stable/2023-06-01/examples/CreateAccountEncryption.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 armmaps_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/maps/armmaps"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b9403296f0b0e112b0d8222ad05fd1d79ee10e03/specification/maps/resource-manager/Microsoft.Maps/stable/2023-06-01/examples/CreateAccountEncryption.json
func ExampleAccountsClient_CreateOrUpdate_createAccountWithEncryption() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armmaps.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
res, err := clientFactory.NewAccountsClient().CreateOrUpdate(ctx, "myResourceGroup", "myMapsAccount", armmaps.Account{
Location: to.Ptr("eastus"),
Identity: &armmaps.ManagedServiceIdentity{
Type: to.Ptr(armmaps.ManagedServiceIdentityTypeUserAssigned),
UserAssignedIdentities: map[string]*armmaps.UserAssignedIdentity{
"/subscriptions/21a9967a-e8a9-4656-a70b-96ff1c4d05a0/resourceGroups/myResourceGroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identityName": {},
},
},
Kind: to.Ptr(armmaps.KindGen2),
Properties: &armmaps.AccountProperties{
Encryption: &armmaps.Encryption{
CustomerManagedKeyEncryption: &armmaps.CustomerManagedKeyEncryption{
KeyEncryptionKeyIdentity: &armmaps.CustomerManagedKeyEncryptionKeyIdentity{
IdentityType: to.Ptr(armmaps.IdentityTypeUserAssignedIdentity),
UserAssignedIdentityResourceID: to.Ptr("/subscriptions/21a9967a-e8a9-4656-a70b-96ff1c4d05a0/resourceGroups/myResourceGroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identityName"),
},
KeyEncryptionKeyURL: to.Ptr("https://contosovault.vault.azure.net/keys/contosokek"),
},
},
},
SKU: &armmaps.SKU{
Name: to.Ptr(armmaps.NameG2),
},
}, nil)
if err != nil {
log.Fatalf("failed to finish the request: %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.Account = armmaps.Account{
// Name: to.Ptr("myMapsAccount"),
// Type: to.Ptr("Microsoft.Maps/accounts"),
// ID: to.Ptr("/subscriptions/21a9967a-e8a9-4656-a70b-96ff1c4d05a0/resourceGroups/myResourceGroup/providers/Microsoft.Maps/accounts/myMapsAccount"),
// Location: to.Ptr("eastus"),
// Tags: map[string]*string{
// "test": to.Ptr("true"),
// },
// Identity: &armmaps.ManagedServiceIdentity{
// Type: to.Ptr(armmaps.ManagedServiceIdentityTypeUserAssigned),
// PrincipalID: to.Ptr("77f72dac-e0aa-484e-9acd-e5e7075310ef"),
// TenantID: to.Ptr("06006684-60c1-4954-a20c-ffd8fbea7276"),
// UserAssignedIdentities: map[string]*armmaps.UserAssignedIdentity{
// "/subscriptions/21a9967a-e8a9-4656-a70b-96ff1c4d05a0/resourceGroups/myResourceGroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identityName": &armmaps.UserAssignedIdentity{
// ClientID: to.Ptr("b602d315-01b5-4265-af23-859edc4f2431"),
// PrincipalID: to.Ptr("ac287332-364a-41d9-a567-9ad86b9fc299"),
// },
// },
// },
// Kind: to.Ptr(armmaps.KindGen2),
// Properties: &armmaps.AccountProperties{
// Encryption: &armmaps.Encryption{
// CustomerManagedKeyEncryption: &armmaps.CustomerManagedKeyEncryption{
// KeyEncryptionKeyIdentity: &armmaps.CustomerManagedKeyEncryptionKeyIdentity{
// IdentityType: to.Ptr(armmaps.IdentityTypeUserAssignedIdentity),
// UserAssignedIdentityResourceID: to.Ptr("/subscriptions/21a9967a-e8a9-4656-a70b-96ff1c4d05a0/resourceGroups/myResourceGroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identityName"),
// },
// KeyEncryptionKeyURL: to.Ptr("https://contosovault.vault.azure.net/keys/contosokek"),
// },
// },
// ProvisioningState: to.Ptr("Succeeded"),
// UniqueID: to.Ptr("b2e763e6-d6f3-4858-9e2b-7cf8df85c593"),
// },
// SKU: &armmaps.SKU{
// Name: to.Ptr(armmaps.NameG2),
// Tier: to.Ptr("Standard"),
// },
// SystemData: &armmaps.SystemData{
// CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-07-02T01:01:01.107Z"); return t}()),
// CreatedBy: to.Ptr("string"),
// CreatedByType: to.Ptr(armmaps.CreatedByTypeApplication),
// LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-07-02T01:01:01.107Z"); return t}()),
// LastModifiedBy: to.Ptr("string"),
// LastModifiedByType: to.Ptr(armmaps.CreatedByTypeApplication),
// },
// }
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
const { AzureMapsManagementClient } = require("@azure/arm-maps");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to Create or update a Maps Account. A Maps Account holds the keys which allow access to the Maps REST APIs.
*
* @summary Create or update a Maps Account. A Maps Account holds the keys which allow access to the Maps REST APIs.
* x-ms-original-file: specification/maps/resource-manager/Microsoft.Maps/stable/2023-06-01/examples/CreateAccountEncryption.json
*/
async function createAccountWithEncryption() {
const subscriptionId =
process.env["MAPS_SUBSCRIPTION_ID"] || "21a9967a-e8a9-4656-a70b-96ff1c4d05a0";
const resourceGroupName = process.env["MAPS_RESOURCE_GROUP"] || "myResourceGroup";
const accountName = "myMapsAccount";
const mapsAccount = {
identity: {
type: "UserAssigned",
userAssignedIdentities: {
"/subscriptions/21a9967aE8a94656A70b96ff1c4d05a0/resourceGroups/myResourceGroup/providers/MicrosoftManagedIdentity/userAssignedIdentities/identityName":
{},
},
},
kind: "Gen2",
location: "eastus",
properties: {
encryption: {
customerManagedKeyEncryption: {
keyEncryptionKeyIdentity: {
identityType: "userAssignedIdentity",
userAssignedIdentityResourceId:
"/subscriptions/21a9967a-e8a9-4656-a70b-96ff1c4d05a0/resourceGroups/myResourceGroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identityName",
},
keyEncryptionKeyUrl: "https://contosovault.vault.azure.net/keys/contosokek",
},
},
},
sku: { name: "G2" },
};
const credential = new DefaultAzureCredential();
const client = new AzureMapsManagementClient(credential, subscriptionId);
const result = await client.accounts.createOrUpdate(resourceGroupName, accountName, mapsAccount);
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
using Azure;
using Azure.ResourceManager;
using System;
using System.Threading.Tasks;
using Azure.Core;
using Azure.Identity;
using Azure.ResourceManager.Maps.Models;
using Azure.ResourceManager.Models;
using Azure.ResourceManager.Resources;
using Azure.ResourceManager.Maps;
// Generated from example definition: specification/maps/resource-manager/Microsoft.Maps/stable/2023-06-01/examples/CreateAccountEncryption.json
// this example is just showing the usage of "Accounts_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately.
// get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line
TokenCredential cred = new DefaultAzureCredential();
// authenticate your client
ArmClient client = new ArmClient(cred);
// this example assumes you already have this ResourceGroupResource created on azure
// for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource
string subscriptionId = "21a9967a-e8a9-4656-a70b-96ff1c4d05a0";
string resourceGroupName = "myResourceGroup";
ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName);
ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId);
// get the collection of this MapsAccountResource
MapsAccountCollection collection = resourceGroupResource.GetMapsAccounts();
// invoke the operation
string accountName = "myMapsAccount";
MapsAccountData data = new MapsAccountData(new AzureLocation("eastus"), new MapsSku(MapsSkuName.G2))
{
Kind = MapsAccountKind.Gen2,
Identity = new ManagedServiceIdentity("UserAssigned")
{
UserAssignedIdentities =
{
[new ResourceIdentifier("/subscriptions/21a9967a-e8a9-4656-a70b-96ff1c4d05a0/resourceGroups/myResourceGroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identityName")] = new UserAssignedIdentity(),
},
},
Properties = new MapsAccountProperties()
{
Encryption = new MapsEncryption()
{
CustomerManagedKeyEncryption = new CustomerManagedKeyEncryption()
{
KeyEncryptionKeyIdentity = new CustomerManagedKeyEncryptionKeyIdentity()
{
IdentityType = MapsIdentityType.UserAssignedIdentity,
UserAssignedIdentityResourceId = new ResourceIdentifier("/subscriptions/21a9967a-e8a9-4656-a70b-96ff1c4d05a0/resourceGroups/myResourceGroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identityName"),
},
KeyEncryptionKeyUri = new Uri("https://contosovault.vault.azure.net/keys/contosokek"),
},
},
},
};
ArmOperation<MapsAccountResource> lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, accountName, data);
MapsAccountResource result = lro.Value;
// the variable result is a resource, you could call other operations on this instance as well
// but just for demo, we get its data from this resource instance
MapsAccountData resourceData = result.Data;
// for demo we just print out the id
Console.WriteLine($"Succeeded on id: {resourceData.Id}");
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
Sample response
{
"id": "/subscriptions/21a9967a-e8a9-4656-a70b-96ff1c4d05a0/resourceGroups/myResourceGroup/providers/Microsoft.Maps/accounts/myMapsAccount",
"name": "myMapsAccount",
"type": "Microsoft.Maps/accounts",
"kind": "Gen2",
"location": "eastus",
"tags": {
"test": "true"
},
"systemData": {
"createdBy": "string",
"createdByType": "Application",
"createdAt": "2021-07-02T01:01:01.1075056Z",
"lastModifiedBy": "string",
"lastModifiedByType": "Application",
"lastModifiedAt": "2021-07-02T01:01:01.1075056Z"
},
"sku": {
"name": "G2",
"tier": "Standard"
},
"identity": {
"type": "UserAssigned",
"principalId": "77f72dac-e0aa-484e-9acd-e5e7075310ef",
"tenantId": "06006684-60c1-4954-a20c-ffd8fbea7276",
"userAssignedIdentities": {
"/subscriptions/21a9967a-e8a9-4656-a70b-96ff1c4d05a0/resourceGroups/myResourceGroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identityName": {
"clientId": "b602d315-01b5-4265-af23-859edc4f2431",
"principalId": "ac287332-364a-41d9-a567-9ad86b9fc299"
}
}
},
"properties": {
"uniqueId": "b2e763e6-d6f3-4858-9e2b-7cf8df85c593",
"provisioningState": "Succeeded",
"encryption": {
"customerManagedKeyEncryption": {
"keyEncryptionKeyIdentity": {
"identityType": "userAssignedIdentity",
"userAssignedIdentityResourceId": "/subscriptions/21a9967a-e8a9-4656-a70b-96ff1c4d05a0/resourceGroups/myResourceGroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identityName"
},
"keyEncryptionKeyUrl": "https://contosovault.vault.azure.net/keys/contosokek"
}
}
}
}
{
"id": "/subscriptions/21a9967a-e8a9-4656-a70b-96ff1c4d05a0/resourceGroups/myResourceGroup/providers/Microsoft.Maps/accounts/myMapsAccount",
"name": "myMapsAccount",
"type": "Microsoft.Maps/accounts",
"kind": "Gen2",
"location": "eastus",
"systemData": {
"createdBy": "string",
"createdByType": "Application",
"createdAt": "2021-07-02T01:01:01.1075056Z",
"lastModifiedBy": "string",
"lastModifiedByType": "Application",
"lastModifiedAt": "2021-07-02T01:01:01.1075056Z"
},
"sku": {
"name": "G2",
"tier": "Standard"
},
"identity": {
"type": "UserAssigned",
"principalId": "77f72dac-e0aa-484e-9acd-e5e7075310ef",
"tenantId": "06006684-60c1-4954-a20c-ffd8fbea7276",
"userAssignedIdentities": {
"/subscriptions/21a9967a-e8a9-4656-a70b-96ff1c4d05a0/resourceGroups/myResourceGroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identityName": {
"clientId": "b602d315-01b5-4265-af23-859edc4f2431",
"principalId": "ac287332-364a-41d9-a567-9ad86b9fc299"
}
}
},
"properties": {
"uniqueId": "b2e763e6-d6f3-4858-9e2b-7cf8df85c593",
"provisioningState": "Updating",
"encryption": {
"customerManagedKeyEncryption": {
"keyEncryptionKeyIdentity": {
"identityType": "userAssignedIdentity",
"userAssignedIdentityResourceId": "/subscriptions/21a9967a-e8a9-4656-a70b-96ff1c4d05a0/resourceGroups/myResourceGroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identityName"
},
"keyEncryptionKeyUrl": "https://contosovault.vault.azure.net/keys/contosokek"
}
}
}
}
Create Account with Managed Identities
Sample request
PUT https://management.azure.com/subscriptions/21a9967a-e8a9-4656-a70b-96ff1c4d05a0/resourceGroups/myResourceGroup/providers/Microsoft.Maps/accounts/myMapsAccount?api-version=2023-06-01
{
"location": "eastus",
"sku": {
"name": "G2"
},
"kind": "Gen2",
"tags": {
"test": "true"
},
"identity": {
"type": "SystemAssigned, UserAssigned",
"userAssignedIdentities": {
"/subscriptions/21a9967a-e8a9-4656-a70b-96ff1c4d05a0/resourceGroups/myResourceGroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identityName": {}
}
},
"properties": {
"disableLocalAuth": false,
"linkedResources": [
{
"id": "/subscriptions/21a9967a-e8a9-4656-a70b-96ff1c4d05a0/resourceGroups/myResourceGroup/providers/Microsoft.Storage/accounts/mystorageacc",
"uniqueName": "myBatchStorageAccount"
},
{
"id": "/subscriptions/21a9967a-e8a9-4656-a70b-96ff1c4d05a0/resourceGroups/myResourceGroup/providers/Microsoft.Storage/accounts/mystorageacc",
"uniqueName": "myBlobDataSource"
}
]
}
}
import com.azure.resourcemanager.maps.fluent.models.MapsAccountProperties;
import com.azure.resourcemanager.maps.models.Kind;
import com.azure.resourcemanager.maps.models.LinkedResource;
import com.azure.resourcemanager.maps.models.ManagedServiceIdentity;
import com.azure.resourcemanager.maps.models.ManagedServiceIdentityType;
import com.azure.resourcemanager.maps.models.Name;
import com.azure.resourcemanager.maps.models.Sku;
import com.azure.resourcemanager.maps.models.UserAssignedIdentity;
import java.util.Arrays;
import java.util.HashMap;
import java.util.Map;
/**
* Samples for Accounts CreateOrUpdate.
*/
public final class Main {
/*
* x-ms-original-file:
* specification/maps/resource-manager/Microsoft.Maps/stable/2023-06-01/examples/CreateAccountManagedIdentity.json
*/
/**
* Sample code: Create Account with Managed Identities.
*
* @param manager Entry point to AzureMapsManager.
*/
public static void createAccountWithManagedIdentities(com.azure.resourcemanager.maps.AzureMapsManager manager) {
manager.accounts().define("myMapsAccount").withRegion("eastus").withExistingResourceGroup("myResourceGroup")
.withSku(new Sku().withName(Name.G2)).withTags(mapOf("test", "true")).withKind(Kind.GEN2)
.withIdentity(new ManagedServiceIdentity()
.withType(ManagedServiceIdentityType.SYSTEM_ASSIGNED_USER_ASSIGNED)
.withUserAssignedIdentities(mapOf(
"/subscriptions/21a9967a-e8a9-4656-a70b-96ff1c4d05a0/resourceGroups/myResourceGroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identityName",
new UserAssignedIdentity())))
.withProperties(new MapsAccountProperties().withDisableLocalAuth(false).withLinkedResources(Arrays.asList(
new LinkedResource().withUniqueName("myBatchStorageAccount").withId(
"/subscriptions/21a9967a-e8a9-4656-a70b-96ff1c4d05a0/resourceGroups/myResourceGroup/providers/Microsoft.Storage/accounts/mystorageacc"),
new LinkedResource().withUniqueName("myBlobDataSource").withId(
"/subscriptions/21a9967a-e8a9-4656-a70b-96ff1c4d05a0/resourceGroups/myResourceGroup/providers/Microsoft.Storage/accounts/mystorageacc"))))
.create();
}
// 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.maps import AzureMapsManagementClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-maps
# USAGE
python create_account_managed_identity.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 = AzureMapsManagementClient(
credential=DefaultAzureCredential(),
subscription_id="21a9967a-e8a9-4656-a70b-96ff1c4d05a0",
)
response = client.accounts.create_or_update(
resource_group_name="myResourceGroup",
account_name="myMapsAccount",
maps_account={
"identity": {
"type": "SystemAssigned, UserAssigned",
"userAssignedIdentities": {
"/subscriptions/21a9967a-e8a9-4656-a70b-96ff1c4d05a0/resourceGroups/myResourceGroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identityName": {}
},
},
"kind": "Gen2",
"location": "eastus",
"properties": {
"disableLocalAuth": False,
"linkedResources": [
{
"id": "/subscriptions/21a9967a-e8a9-4656-a70b-96ff1c4d05a0/resourceGroups/myResourceGroup/providers/Microsoft.Storage/accounts/mystorageacc",
"uniqueName": "myBatchStorageAccount",
},
{
"id": "/subscriptions/21a9967a-e8a9-4656-a70b-96ff1c4d05a0/resourceGroups/myResourceGroup/providers/Microsoft.Storage/accounts/mystorageacc",
"uniqueName": "myBlobDataSource",
},
],
},
"sku": {"name": "G2"},
"tags": {"test": "true"},
},
)
print(response)
# x-ms-original-file: specification/maps/resource-manager/Microsoft.Maps/stable/2023-06-01/examples/CreateAccountManagedIdentity.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 armmaps_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/maps/armmaps"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b9403296f0b0e112b0d8222ad05fd1d79ee10e03/specification/maps/resource-manager/Microsoft.Maps/stable/2023-06-01/examples/CreateAccountManagedIdentity.json
func ExampleAccountsClient_CreateOrUpdate_createAccountWithManagedIdentities() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armmaps.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
res, err := clientFactory.NewAccountsClient().CreateOrUpdate(ctx, "myResourceGroup", "myMapsAccount", armmaps.Account{
Location: to.Ptr("eastus"),
Tags: map[string]*string{
"test": to.Ptr("true"),
},
Identity: &armmaps.ManagedServiceIdentity{
Type: to.Ptr(armmaps.ManagedServiceIdentityTypeSystemAssignedUserAssigned),
UserAssignedIdentities: map[string]*armmaps.UserAssignedIdentity{
"/subscriptions/21a9967a-e8a9-4656-a70b-96ff1c4d05a0/resourceGroups/myResourceGroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identityName": {},
},
},
Kind: to.Ptr(armmaps.KindGen2),
Properties: &armmaps.AccountProperties{
DisableLocalAuth: to.Ptr(false),
LinkedResources: []*armmaps.LinkedResource{
{
ID: to.Ptr("/subscriptions/21a9967a-e8a9-4656-a70b-96ff1c4d05a0/resourceGroups/myResourceGroup/providers/Microsoft.Storage/accounts/mystorageacc"),
UniqueName: to.Ptr("myBatchStorageAccount"),
},
{
ID: to.Ptr("/subscriptions/21a9967a-e8a9-4656-a70b-96ff1c4d05a0/resourceGroups/myResourceGroup/providers/Microsoft.Storage/accounts/mystorageacc"),
UniqueName: to.Ptr("myBlobDataSource"),
}},
},
SKU: &armmaps.SKU{
Name: to.Ptr(armmaps.NameG2),
},
}, nil)
if err != nil {
log.Fatalf("failed to finish the request: %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.Account = armmaps.Account{
// Name: to.Ptr("myMapsAccount"),
// Type: to.Ptr("Microsoft.Maps/accounts"),
// ID: to.Ptr("/subscriptions/21a9967a-e8a9-4656-a70b-96ff1c4d05a0/resourceGroups/myResourceGroup/providers/Microsoft.Maps/accounts/myMapsAccount"),
// Location: to.Ptr("eastus"),
// Tags: map[string]*string{
// "test": to.Ptr("true"),
// },
// Identity: &armmaps.ManagedServiceIdentity{
// Type: to.Ptr(armmaps.ManagedServiceIdentityTypeSystemAssignedUserAssigned),
// PrincipalID: to.Ptr("77f72dac-e0aa-484e-9acd-e5e7075310ef"),
// TenantID: to.Ptr("06006684-60c1-4954-a20c-ffd8fbea7276"),
// UserAssignedIdentities: map[string]*armmaps.UserAssignedIdentity{
// "/subscriptions/21a9967a-e8a9-4656-a70b-96ff1c4d05a0/resourceGroups/myResourceGroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identityName": &armmaps.UserAssignedIdentity{
// ClientID: to.Ptr("b602d315-01b5-4265-af23-859edc4f2431"),
// PrincipalID: to.Ptr("ac287332-364a-41d9-a567-9ad86b9fc299"),
// },
// },
// },
// Kind: to.Ptr(armmaps.KindGen2),
// Properties: &armmaps.AccountProperties{
// DisableLocalAuth: to.Ptr(true),
// LinkedResources: []*armmaps.LinkedResource{
// {
// ID: to.Ptr("/subscriptions/21a9967a-e8a9-4656-a70b-96ff1c4d05a0/resourceGroups/myResourceGroup/providers/Microsoft.Storage/accounts/mystorageacc"),
// UniqueName: to.Ptr("myBatchStorageAccount"),
// },
// {
// ID: to.Ptr("/subscriptions/21a9967a-e8a9-4656-a70b-96ff1c4d05a0/resourceGroups/myResourceGroup/providers/Microsoft.Storage/accounts/mystorageacc"),
// UniqueName: to.Ptr("myBlobDataSource"),
// }},
// ProvisioningState: to.Ptr("Succeeded"),
// UniqueID: to.Ptr("b2e763e6-d6f3-4858-9e2b-7cf8df85c593"),
// },
// SKU: &armmaps.SKU{
// Name: to.Ptr(armmaps.NameG2),
// Tier: to.Ptr("Standard"),
// },
// SystemData: &armmaps.SystemData{
// CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-07-02T01:01:01.107Z"); return t}()),
// CreatedBy: to.Ptr("string"),
// CreatedByType: to.Ptr(armmaps.CreatedByTypeApplication),
// LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-07-02T01:01:01.107Z"); return t}()),
// LastModifiedBy: to.Ptr("string"),
// LastModifiedByType: to.Ptr(armmaps.CreatedByTypeApplication),
// },
// }
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
const { AzureMapsManagementClient } = require("@azure/arm-maps");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to Create or update a Maps Account. A Maps Account holds the keys which allow access to the Maps REST APIs.
*
* @summary Create or update a Maps Account. A Maps Account holds the keys which allow access to the Maps REST APIs.
* x-ms-original-file: specification/maps/resource-manager/Microsoft.Maps/stable/2023-06-01/examples/CreateAccountManagedIdentity.json
*/
async function createAccountWithManagedIdentities() {
const subscriptionId =
process.env["MAPS_SUBSCRIPTION_ID"] || "21a9967a-e8a9-4656-a70b-96ff1c4d05a0";
const resourceGroupName = process.env["MAPS_RESOURCE_GROUP"] || "myResourceGroup";
const accountName = "myMapsAccount";
const mapsAccount = {
identity: {
type: "SystemAssigned, UserAssigned",
userAssignedIdentities: {
"/subscriptions/21a9967aE8a94656A70b96ff1c4d05a0/resourceGroups/myResourceGroup/providers/MicrosoftManagedIdentity/userAssignedIdentities/identityName":
{},
},
},
kind: "Gen2",
location: "eastus",
properties: {
disableLocalAuth: false,
linkedResources: [
{
id: "/subscriptions/21a9967a-e8a9-4656-a70b-96ff1c4d05a0/resourceGroups/myResourceGroup/providers/Microsoft.Storage/accounts/mystorageacc",
uniqueName: "myBatchStorageAccount",
},
{
id: "/subscriptions/21a9967a-e8a9-4656-a70b-96ff1c4d05a0/resourceGroups/myResourceGroup/providers/Microsoft.Storage/accounts/mystorageacc",
uniqueName: "myBlobDataSource",
},
],
},
sku: { name: "G2" },
tags: { test: "true" },
};
const credential = new DefaultAzureCredential();
const client = new AzureMapsManagementClient(credential, subscriptionId);
const result = await client.accounts.createOrUpdate(resourceGroupName, accountName, mapsAccount);
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
using Azure;
using Azure.ResourceManager;
using System;
using System.Threading.Tasks;
using Azure.Core;
using Azure.Identity;
using Azure.ResourceManager.Maps.Models;
using Azure.ResourceManager.Models;
using Azure.ResourceManager.Resources;
using Azure.ResourceManager.Maps;
// Generated from example definition: specification/maps/resource-manager/Microsoft.Maps/stable/2023-06-01/examples/CreateAccountManagedIdentity.json
// this example is just showing the usage of "Accounts_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately.
// get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line
TokenCredential cred = new DefaultAzureCredential();
// authenticate your client
ArmClient client = new ArmClient(cred);
// this example assumes you already have this ResourceGroupResource created on azure
// for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource
string subscriptionId = "21a9967a-e8a9-4656-a70b-96ff1c4d05a0";
string resourceGroupName = "myResourceGroup";
ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName);
ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId);
// get the collection of this MapsAccountResource
MapsAccountCollection collection = resourceGroupResource.GetMapsAccounts();
// invoke the operation
string accountName = "myMapsAccount";
MapsAccountData data = new MapsAccountData(new AzureLocation("eastus"), new MapsSku(MapsSkuName.G2))
{
Kind = MapsAccountKind.Gen2,
Identity = new ManagedServiceIdentity("SystemAssigned, UserAssigned")
{
UserAssignedIdentities =
{
[new ResourceIdentifier("/subscriptions/21a9967a-e8a9-4656-a70b-96ff1c4d05a0/resourceGroups/myResourceGroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identityName")] = new UserAssignedIdentity(),
},
},
Properties = new MapsAccountProperties()
{
DisableLocalAuth = false,
LinkedResources =
{
new MapsLinkedResource("myBatchStorageAccount","/subscriptions/21a9967a-e8a9-4656-a70b-96ff1c4d05a0/resourceGroups/myResourceGroup/providers/Microsoft.Storage/accounts/mystorageacc"),new MapsLinkedResource("myBlobDataSource","/subscriptions/21a9967a-e8a9-4656-a70b-96ff1c4d05a0/resourceGroups/myResourceGroup/providers/Microsoft.Storage/accounts/mystorageacc")
},
},
Tags =
{
["test"] = "true",
},
};
ArmOperation<MapsAccountResource> lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, accountName, data);
MapsAccountResource result = lro.Value;
// the variable result is a resource, you could call other operations on this instance as well
// but just for demo, we get its data from this resource instance
MapsAccountData resourceData = result.Data;
// for demo we just print out the id
Console.WriteLine($"Succeeded on id: {resourceData.Id}");
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
Sample response
{
"id": "/subscriptions/21a9967a-e8a9-4656-a70b-96ff1c4d05a0/resourceGroups/myResourceGroup/providers/Microsoft.Maps/accounts/myMapsAccount",
"name": "myMapsAccount",
"type": "Microsoft.Maps/accounts",
"kind": "Gen2",
"location": "eastus",
"tags": {
"test": "true"
},
"systemData": {
"createdBy": "string",
"createdByType": "Application",
"createdAt": "2021-07-02T01:01:01.1075056Z",
"lastModifiedBy": "string",
"lastModifiedByType": "Application",
"lastModifiedAt": "2021-07-02T01:01:01.1075056Z"
},
"sku": {
"name": "G2",
"tier": "Standard"
},
"identity": {
"type": "SystemAssigned, UserAssigned",
"principalId": "77f72dac-e0aa-484e-9acd-e5e7075310ef",
"tenantId": "06006684-60c1-4954-a20c-ffd8fbea7276",
"userAssignedIdentities": {
"/subscriptions/21a9967a-e8a9-4656-a70b-96ff1c4d05a0/resourceGroups/myResourceGroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identityName": {
"clientId": "b602d315-01b5-4265-af23-859edc4f2431",
"principalId": "ac287332-364a-41d9-a567-9ad86b9fc299"
}
}
},
"properties": {
"uniqueId": "b2e763e6-d6f3-4858-9e2b-7cf8df85c593",
"provisioningState": "Succeeded",
"disableLocalAuth": true,
"linkedResources": [
{
"id": "/subscriptions/21a9967a-e8a9-4656-a70b-96ff1c4d05a0/resourceGroups/myResourceGroup/providers/Microsoft.Storage/accounts/mystorageacc",
"uniqueName": "myBatchStorageAccount"
},
{
"id": "/subscriptions/21a9967a-e8a9-4656-a70b-96ff1c4d05a0/resourceGroups/myResourceGroup/providers/Microsoft.Storage/accounts/mystorageacc",
"uniqueName": "myBlobDataSource"
}
]
}
}
{
"id": "/subscriptions/21a9967a-e8a9-4656-a70b-96ff1c4d05a0/resourceGroups/myResourceGroup/providers/Microsoft.Maps/accounts/myMapsAccount",
"name": "myMapsAccount",
"type": "Microsoft.Maps/accounts",
"kind": "Gen2",
"location": "eastus",
"tags": {
"test": "true"
},
"systemData": {
"createdBy": "string",
"createdByType": "Application",
"createdAt": "2021-07-02T01:01:01.1075056Z",
"lastModifiedBy": "string",
"lastModifiedByType": "Application",
"lastModifiedAt": "2021-07-02T01:01:01.1075056Z"
},
"sku": {
"name": "G2",
"tier": "Standard"
},
"identity": {
"type": "SystemAssigned, UserAssigned",
"principalId": "77f72dac-e0aa-484e-9acd-e5e7075310ef",
"tenantId": "06006684-60c1-4954-a20c-ffd8fbea7276",
"userAssignedIdentities": {
"/subscriptions/21a9967a-e8a9-4656-a70b-96ff1c4d05a0/resourceGroups/myResourceGroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identityName": {
"clientId": "b602d315-01b5-4265-af23-859edc4f2431",
"principalId": "ac287332-364a-41d9-a567-9ad86b9fc299"
}
}
},
"properties": {
"uniqueId": "b2e763e6-d6f3-4858-9e2b-7cf8df85c593",
"provisioningState": "Succeeded",
"disableLocalAuth": true,
"linkedResources": [
{
"id": "/subscriptions/21a9967a-e8a9-4656-a70b-96ff1c4d05a0/resourceGroups/myResourceGroup/providers/Microsoft.Storage/accounts/mystorageacc",
"uniqueName": "myBatchStorageAccount"
},
{
"id": "/subscriptions/21a9967a-e8a9-4656-a70b-96ff1c4d05a0/resourceGroups/myResourceGroup/providers/Microsoft.Storage/accounts/mystorageacc",
"uniqueName": "myBlobDataSource"
}
]
}
}
Create Gen1 Account
Sample request
PUT https://management.azure.com/subscriptions/21a9967a-e8a9-4656-a70b-96ff1c4d05a0/resourceGroups/myResourceGroup/providers/Microsoft.Maps/accounts/myMapsAccount?api-version=2023-06-01
{
"location": "eastus",
"sku": {
"name": "S0"
},
"kind": "Gen1",
"tags": {
"test": "true"
},
"properties": {
"disableLocalAuth": false,
"cors": {
"corsRules": [
{
"allowedOrigins": [
"http://www.contoso.com",
"http://www.fabrikam.com"
]
}
]
}
}
}
import com.azure.resourcemanager.maps.fluent.models.MapsAccountProperties;
import com.azure.resourcemanager.maps.models.CorsRule;
import com.azure.resourcemanager.maps.models.CorsRules;
import com.azure.resourcemanager.maps.models.Kind;
import com.azure.resourcemanager.maps.models.Name;
import com.azure.resourcemanager.maps.models.Sku;
import java.util.Arrays;
import java.util.HashMap;
import java.util.Map;
/**
* Samples for Accounts CreateOrUpdate.
*/
public final class Main {
/*
* x-ms-original-file:
* specification/maps/resource-manager/Microsoft.Maps/stable/2023-06-01/examples/CreateAccount.json
*/
/**
* Sample code: Create Gen1 Account.
*
* @param manager Entry point to AzureMapsManager.
*/
public static void createGen1Account(com.azure.resourcemanager.maps.AzureMapsManager manager) {
manager.accounts().define("myMapsAccount").withRegion("eastus").withExistingResourceGroup("myResourceGroup")
.withSku(new Sku().withName(Name.S0)).withTags(mapOf("test", "true")).withKind(Kind.GEN1)
.withProperties(new MapsAccountProperties().withDisableLocalAuth(false)
.withCors(new CorsRules().withCorsRules(Arrays.asList(new CorsRule()
.withAllowedOrigins(Arrays.asList("http://www.contoso.com", "http://www.fabrikam.com"))))))
.create();
}
// 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.maps import AzureMapsManagementClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-maps
# USAGE
python create_account.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 = AzureMapsManagementClient(
credential=DefaultAzureCredential(),
subscription_id="21a9967a-e8a9-4656-a70b-96ff1c4d05a0",
)
response = client.accounts.create_or_update(
resource_group_name="myResourceGroup",
account_name="myMapsAccount",
maps_account={
"kind": "Gen1",
"location": "eastus",
"properties": {
"cors": {"corsRules": [{"allowedOrigins": ["http://www.contoso.com", "http://www.fabrikam.com"]}]},
"disableLocalAuth": False,
},
"sku": {"name": "S0"},
"tags": {"test": "true"},
},
)
print(response)
# x-ms-original-file: specification/maps/resource-manager/Microsoft.Maps/stable/2023-06-01/examples/CreateAccount.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 armmaps_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/maps/armmaps"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b9403296f0b0e112b0d8222ad05fd1d79ee10e03/specification/maps/resource-manager/Microsoft.Maps/stable/2023-06-01/examples/CreateAccount.json
func ExampleAccountsClient_CreateOrUpdate_createGen1Account() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armmaps.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
res, err := clientFactory.NewAccountsClient().CreateOrUpdate(ctx, "myResourceGroup", "myMapsAccount", armmaps.Account{
Location: to.Ptr("eastus"),
Tags: map[string]*string{
"test": to.Ptr("true"),
},
Kind: to.Ptr(armmaps.KindGen1),
Properties: &armmaps.AccountProperties{
Cors: &armmaps.CorsRules{
CorsRules: []*armmaps.CorsRule{
{
AllowedOrigins: []*string{
to.Ptr("http://www.contoso.com"),
to.Ptr("http://www.fabrikam.com")},
}},
},
DisableLocalAuth: to.Ptr(false),
},
SKU: &armmaps.SKU{
Name: to.Ptr(armmaps.NameS0),
},
}, nil)
if err != nil {
log.Fatalf("failed to finish the request: %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.Account = armmaps.Account{
// Name: to.Ptr("myMapsAccount"),
// Type: to.Ptr("Microsoft.Maps/accounts"),
// ID: to.Ptr("/subscriptions/21a9967a-e8a9-4656-a70b-96ff1c4d05a0/resourceGroups/myResourceGroup/providers/Microsoft.Maps/accounts/myMapsAccount"),
// Location: to.Ptr("eastus"),
// Tags: map[string]*string{
// "test": to.Ptr("true"),
// },
// Kind: to.Ptr(armmaps.KindGen1),
// Properties: &armmaps.AccountProperties{
// Cors: &armmaps.CorsRules{
// CorsRules: []*armmaps.CorsRule{
// {
// AllowedOrigins: []*string{
// to.Ptr("http://www.contoso.com"),
// to.Ptr("http://www.fabrikam.com")},
// }},
// },
// DisableLocalAuth: to.Ptr(false),
// ProvisioningState: to.Ptr("Succeeded"),
// UniqueID: to.Ptr("b2e763e6-d6f3-4858-9e2b-7cf8df85c593"),
// },
// SKU: &armmaps.SKU{
// Name: to.Ptr(armmaps.NameS0),
// Tier: to.Ptr("Standard"),
// },
// SystemData: &armmaps.SystemData{
// CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-07-02T01:01:01.107Z"); return t}()),
// CreatedBy: to.Ptr("string"),
// CreatedByType: to.Ptr(armmaps.CreatedByTypeApplication),
// LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-07-02T01:01:01.107Z"); return t}()),
// LastModifiedBy: to.Ptr("string"),
// LastModifiedByType: to.Ptr(armmaps.CreatedByTypeApplication),
// },
// }
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
const { AzureMapsManagementClient } = require("@azure/arm-maps");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to Create or update a Maps Account. A Maps Account holds the keys which allow access to the Maps REST APIs.
*
* @summary Create or update a Maps Account. A Maps Account holds the keys which allow access to the Maps REST APIs.
* x-ms-original-file: specification/maps/resource-manager/Microsoft.Maps/stable/2023-06-01/examples/CreateAccount.json
*/
async function createGen1Account() {
const subscriptionId =
process.env["MAPS_SUBSCRIPTION_ID"] || "21a9967a-e8a9-4656-a70b-96ff1c4d05a0";
const resourceGroupName = process.env["MAPS_RESOURCE_GROUP"] || "myResourceGroup";
const accountName = "myMapsAccount";
const mapsAccount = {
kind: "Gen1",
location: "eastus",
properties: {
cors: {
corsRules: [
{
allowedOrigins: ["http://www.contoso.com", "http://www.fabrikam.com"],
},
],
},
disableLocalAuth: false,
},
sku: { name: "S0" },
tags: { test: "true" },
};
const credential = new DefaultAzureCredential();
const client = new AzureMapsManagementClient(credential, subscriptionId);
const result = await client.accounts.createOrUpdate(resourceGroupName, accountName, mapsAccount);
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
using Azure;
using Azure.ResourceManager;
using System;
using System.Threading.Tasks;
using Azure.Core;
using Azure.Identity;
using Azure.ResourceManager.Maps.Models;
using Azure.ResourceManager.Models;
using Azure.ResourceManager.Resources;
using Azure.ResourceManager.Maps;
// Generated from example definition: specification/maps/resource-manager/Microsoft.Maps/stable/2023-06-01/examples/CreateAccount.json
// this example is just showing the usage of "Accounts_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately.
// get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line
TokenCredential cred = new DefaultAzureCredential();
// authenticate your client
ArmClient client = new ArmClient(cred);
// this example assumes you already have this ResourceGroupResource created on azure
// for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource
string subscriptionId = "21a9967a-e8a9-4656-a70b-96ff1c4d05a0";
string resourceGroupName = "myResourceGroup";
ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName);
ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId);
// get the collection of this MapsAccountResource
MapsAccountCollection collection = resourceGroupResource.GetMapsAccounts();
// invoke the operation
string accountName = "myMapsAccount";
MapsAccountData data = new MapsAccountData(new AzureLocation("eastus"), new MapsSku(MapsSkuName.S0))
{
Kind = MapsAccountKind.Gen1,
Properties = new MapsAccountProperties()
{
DisableLocalAuth = false,
CorsRulesValue =
{
new MapsCorsRule(new string[]
{
"http://www.contoso.com","http://www.fabrikam.com"
})
},
},
Tags =
{
["test"] = "true",
},
};
ArmOperation<MapsAccountResource> lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, accountName, data);
MapsAccountResource result = lro.Value;
// the variable result is a resource, you could call other operations on this instance as well
// but just for demo, we get its data from this resource instance
MapsAccountData resourceData = result.Data;
// for demo we just print out the id
Console.WriteLine($"Succeeded on id: {resourceData.Id}");
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
Sample response
{
"id": "/subscriptions/21a9967a-e8a9-4656-a70b-96ff1c4d05a0/resourceGroups/myResourceGroup/providers/Microsoft.Maps/accounts/myMapsAccount",
"name": "myMapsAccount",
"type": "Microsoft.Maps/accounts",
"kind": "Gen1",
"location": "eastus",
"tags": {
"test": "true"
},
"systemData": {
"createdBy": "string",
"createdByType": "Application",
"createdAt": "2021-07-02T01:01:01.1075056Z",
"lastModifiedBy": "string",
"lastModifiedByType": "Application",
"lastModifiedAt": "2021-07-02T01:01:01.1075056Z"
},
"sku": {
"name": "S0",
"tier": "Standard"
},
"properties": {
"uniqueId": "b2e763e6-d6f3-4858-9e2b-7cf8df85c593",
"provisioningState": "Succeeded",
"disableLocalAuth": false,
"cors": {
"corsRules": [
{
"allowedOrigins": [
"http://www.contoso.com",
"http://www.fabrikam.com"
]
}
]
}
}
}
{
"id": "/subscriptions/21a9967a-e8a9-4656-a70b-96ff1c4d05a0/resourceGroups/myResourceGroup/providers/Microsoft.Maps/accounts/myMapsAccount",
"name": "myMapsAccount",
"type": "Microsoft.Maps/accounts",
"kind": "Gen1",
"location": "eastus",
"tags": {
"test": "true"
},
"systemData": {
"createdBy": "string",
"createdByType": "Application",
"createdAt": "2021-07-02T01:01:01.1075056Z",
"lastModifiedBy": "string",
"lastModifiedByType": "Application",
"lastModifiedAt": "2021-07-02T01:01:01.1075056Z"
},
"sku": {
"name": "S0",
"tier": "Standard"
},
"properties": {
"uniqueId": "b2e763e6-d6f3-4858-9e2b-7cf8df85c593",
"provisioningState": "Succeeded",
"disableLocalAuth": false,
"cors": {
"corsRules": [
{
"allowedOrigins": [
"http://www.contoso.com",
"http://www.fabrikam.com"
]
}
]
}
}
}
Create Gen2 Account
Sample request
PUT https://management.azure.com/subscriptions/21a9967a-e8a9-4656-a70b-96ff1c4d05a0/resourceGroups/myResourceGroup/providers/Microsoft.Maps/accounts/myMapsAccount?api-version=2023-06-01
{
"location": "eastus",
"sku": {
"name": "G2"
},
"kind": "Gen2",
"tags": {
"test": "true"
},
"properties": {
"disableLocalAuth": true,
"cors": {
"corsRules": [
{
"allowedOrigins": [
"http://www.contoso.com",
"http://www.fabrikam.com"
]
}
]
}
}
}
import com.azure.resourcemanager.maps.fluent.models.MapsAccountProperties;
import com.azure.resourcemanager.maps.models.CorsRule;
import com.azure.resourcemanager.maps.models.CorsRules;
import com.azure.resourcemanager.maps.models.Kind;
import com.azure.resourcemanager.maps.models.Name;
import com.azure.resourcemanager.maps.models.Sku;
import java.util.Arrays;
import java.util.HashMap;
import java.util.Map;
/**
* Samples for Accounts CreateOrUpdate.
*/
public final class Main {
/*
* x-ms-original-file:
* specification/maps/resource-manager/Microsoft.Maps/stable/2023-06-01/examples/CreateAccountGen2.json
*/
/**
* Sample code: Create Gen2 Account.
*
* @param manager Entry point to AzureMapsManager.
*/
public static void createGen2Account(com.azure.resourcemanager.maps.AzureMapsManager manager) {
manager.accounts().define("myMapsAccount").withRegion("eastus").withExistingResourceGroup("myResourceGroup")
.withSku(new Sku().withName(Name.G2)).withTags(mapOf("test", "true")).withKind(Kind.GEN2)
.withProperties(new MapsAccountProperties().withDisableLocalAuth(true)
.withCors(new CorsRules().withCorsRules(Arrays.asList(new CorsRule()
.withAllowedOrigins(Arrays.asList("http://www.contoso.com", "http://www.fabrikam.com"))))))
.create();
}
// 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.maps import AzureMapsManagementClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-maps
# USAGE
python create_account_gen2.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 = AzureMapsManagementClient(
credential=DefaultAzureCredential(),
subscription_id="21a9967a-e8a9-4656-a70b-96ff1c4d05a0",
)
response = client.accounts.create_or_update(
resource_group_name="myResourceGroup",
account_name="myMapsAccount",
maps_account={
"kind": "Gen2",
"location": "eastus",
"properties": {
"cors": {"corsRules": [{"allowedOrigins": ["http://www.contoso.com", "http://www.fabrikam.com"]}]},
"disableLocalAuth": True,
},
"sku": {"name": "G2"},
"tags": {"test": "true"},
},
)
print(response)
# x-ms-original-file: specification/maps/resource-manager/Microsoft.Maps/stable/2023-06-01/examples/CreateAccountGen2.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 armmaps_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/maps/armmaps"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b9403296f0b0e112b0d8222ad05fd1d79ee10e03/specification/maps/resource-manager/Microsoft.Maps/stable/2023-06-01/examples/CreateAccountGen2.json
func ExampleAccountsClient_CreateOrUpdate_createGen2Account() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armmaps.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
res, err := clientFactory.NewAccountsClient().CreateOrUpdate(ctx, "myResourceGroup", "myMapsAccount", armmaps.Account{
Location: to.Ptr("eastus"),
Tags: map[string]*string{
"test": to.Ptr("true"),
},
Kind: to.Ptr(armmaps.KindGen2),
Properties: &armmaps.AccountProperties{
Cors: &armmaps.CorsRules{
CorsRules: []*armmaps.CorsRule{
{
AllowedOrigins: []*string{
to.Ptr("http://www.contoso.com"),
to.Ptr("http://www.fabrikam.com")},
}},
},
DisableLocalAuth: to.Ptr(true),
},
SKU: &armmaps.SKU{
Name: to.Ptr(armmaps.NameG2),
},
}, nil)
if err != nil {
log.Fatalf("failed to finish the request: %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.Account = armmaps.Account{
// Name: to.Ptr("myMapsAccount"),
// Type: to.Ptr("Microsoft.Maps/accounts"),
// ID: to.Ptr("/subscriptions/21a9967a-e8a9-4656-a70b-96ff1c4d05a0/resourceGroups/myResourceGroup/providers/Microsoft.Maps/accounts/myMapsAccount"),
// Location: to.Ptr("eastus"),
// Tags: map[string]*string{
// "test": to.Ptr("true"),
// },
// Kind: to.Ptr(armmaps.KindGen2),
// Properties: &armmaps.AccountProperties{
// Cors: &armmaps.CorsRules{
// CorsRules: []*armmaps.CorsRule{
// {
// AllowedOrigins: []*string{
// to.Ptr("http://www.contoso.com"),
// to.Ptr("http://www.fabrikam.com")},
// }},
// },
// DisableLocalAuth: to.Ptr(true),
// ProvisioningState: to.Ptr("Succeeded"),
// UniqueID: to.Ptr("b2e763e6-d6f3-4858-9e2b-7cf8df85c593"),
// },
// SKU: &armmaps.SKU{
// Name: to.Ptr(armmaps.NameG2),
// Tier: to.Ptr("Standard"),
// },
// SystemData: &armmaps.SystemData{
// CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-07-02T01:01:01.107Z"); return t}()),
// CreatedBy: to.Ptr("string"),
// CreatedByType: to.Ptr(armmaps.CreatedByTypeApplication),
// LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-07-02T01:01:01.107Z"); return t}()),
// LastModifiedBy: to.Ptr("string"),
// LastModifiedByType: to.Ptr(armmaps.CreatedByTypeApplication),
// },
// }
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
const { AzureMapsManagementClient } = require("@azure/arm-maps");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to Create or update a Maps Account. A Maps Account holds the keys which allow access to the Maps REST APIs.
*
* @summary Create or update a Maps Account. A Maps Account holds the keys which allow access to the Maps REST APIs.
* x-ms-original-file: specification/maps/resource-manager/Microsoft.Maps/stable/2023-06-01/examples/CreateAccountGen2.json
*/
async function createGen2Account() {
const subscriptionId =
process.env["MAPS_SUBSCRIPTION_ID"] || "21a9967a-e8a9-4656-a70b-96ff1c4d05a0";
const resourceGroupName = process.env["MAPS_RESOURCE_GROUP"] || "myResourceGroup";
const accountName = "myMapsAccount";
const mapsAccount = {
kind: "Gen2",
location: "eastus",
properties: {
cors: {
corsRules: [
{
allowedOrigins: ["http://www.contoso.com", "http://www.fabrikam.com"],
},
],
},
disableLocalAuth: true,
},
sku: { name: "G2" },
tags: { test: "true" },
};
const credential = new DefaultAzureCredential();
const client = new AzureMapsManagementClient(credential, subscriptionId);
const result = await client.accounts.createOrUpdate(resourceGroupName, accountName, mapsAccount);
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
using Azure;
using Azure.ResourceManager;
using System;
using System.Threading.Tasks;
using Azure.Core;
using Azure.Identity;
using Azure.ResourceManager.Maps.Models;
using Azure.ResourceManager.Models;
using Azure.ResourceManager.Resources;
using Azure.ResourceManager.Maps;
// Generated from example definition: specification/maps/resource-manager/Microsoft.Maps/stable/2023-06-01/examples/CreateAccountGen2.json
// this example is just showing the usage of "Accounts_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately.
// get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line
TokenCredential cred = new DefaultAzureCredential();
// authenticate your client
ArmClient client = new ArmClient(cred);
// this example assumes you already have this ResourceGroupResource created on azure
// for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource
string subscriptionId = "21a9967a-e8a9-4656-a70b-96ff1c4d05a0";
string resourceGroupName = "myResourceGroup";
ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName);
ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId);
// get the collection of this MapsAccountResource
MapsAccountCollection collection = resourceGroupResource.GetMapsAccounts();
// invoke the operation
string accountName = "myMapsAccount";
MapsAccountData data = new MapsAccountData(new AzureLocation("eastus"), new MapsSku(MapsSkuName.G2))
{
Kind = MapsAccountKind.Gen2,
Properties = new MapsAccountProperties()
{
DisableLocalAuth = true,
CorsRulesValue =
{
new MapsCorsRule(new string[]
{
"http://www.contoso.com","http://www.fabrikam.com"
})
},
},
Tags =
{
["test"] = "true",
},
};
ArmOperation<MapsAccountResource> lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, accountName, data);
MapsAccountResource result = lro.Value;
// the variable result is a resource, you could call other operations on this instance as well
// but just for demo, we get its data from this resource instance
MapsAccountData resourceData = result.Data;
// for demo we just print out the id
Console.WriteLine($"Succeeded on id: {resourceData.Id}");
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
Sample response
{
"id": "/subscriptions/21a9967a-e8a9-4656-a70b-96ff1c4d05a0/resourceGroups/myResourceGroup/providers/Microsoft.Maps/accounts/myMapsAccount",
"name": "myMapsAccount",
"type": "Microsoft.Maps/accounts",
"kind": "Gen2",
"location": "eastus",
"tags": {
"test": "true"
},
"systemData": {
"createdBy": "string",
"createdByType": "Application",
"createdAt": "2021-07-02T01:01:01.1075056Z",
"lastModifiedBy": "string",
"lastModifiedByType": "Application",
"lastModifiedAt": "2021-07-02T01:01:01.1075056Z"
},
"sku": {
"name": "G2",
"tier": "Standard"
},
"properties": {
"uniqueId": "b2e763e6-d6f3-4858-9e2b-7cf8df85c593",
"provisioningState": "Succeeded",
"disableLocalAuth": true,
"cors": {
"corsRules": [
{
"allowedOrigins": [
"http://www.contoso.com",
"http://www.fabrikam.com"
]
}
]
}
}
}
{
"id": "/subscriptions/21a9967a-e8a9-4656-a70b-96ff1c4d05a0/resourceGroups/myResourceGroup/providers/Microsoft.Maps/accounts/myMapsAccount",
"name": "myMapsAccount",
"type": "Microsoft.Maps/accounts",
"kind": "Gen2",
"location": "eastus",
"tags": {
"test": "true"
},
"systemData": {
"createdBy": "string",
"createdByType": "Application",
"createdAt": "2021-07-02T01:01:01.1075056Z",
"lastModifiedBy": "string",
"lastModifiedByType": "Application",
"lastModifiedAt": "2021-07-02T01:01:01.1075056Z"
},
"sku": {
"name": "G2",
"tier": "Standard"
},
"properties": {
"uniqueId": "b2e763e6-d6f3-4858-9e2b-7cf8df85c593",
"provisioningState": "Succeeded",
"disableLocalAuth": true,
"cors": {
"corsRules": [
{
"allowedOrigins": [
"http://www.contoso.com",
"http://www.fabrikam.com"
]
}
]
}
}
}
Definitions
Name |
Description |
CorsRule
|
Specifies a CORS rule for the Map Account.
|
CorsRules
|
Sets the CORS rules. You can include up to five CorsRule elements in the request.
|
createdByType
|
The type of identity that created the resource.
|
customerManagedKeyEncryption
|
All Customer-managed key encryption properties for the resource.
|
encryption
|
(Optional) Discouraged to include in resource definition. Only needed where it is possible to disable platform (AKA infrastructure) encryption. Azure SQL TDE is an example of this. Values are enabled and disabled.
|
ErrorAdditionalInfo
|
The resource management error additional info.
|
ErrorDetail
|
The error detail.
|
ErrorResponse
|
Error response
|
IdentityType
|
Values can be systemAssignedIdentity or userAssignedIdentity
|
InfrastructureEncryption
|
Values are enabled and disabled.
|
KeyEncryptionKeyIdentity
|
All identity configuration for Customer-managed key settings defining which identity should be used to auth to Key Vault.
|
kind
|
Get or Set Kind property.
|
LinkedResource
|
Linked resource is reference to a resource deployed in an Azure subscription, add the linked resource uniqueName value as an optional parameter for operations on Azure Maps Geospatial REST APIs.
|
ManagedServiceIdentity
|
Managed service identity (system assigned and/or user assigned identities)
|
ManagedServiceIdentityType
|
Type of managed service identity (where both SystemAssigned and UserAssigned types are allowed).
|
MapsAccount
|
An Azure resource which represents access to a suite of Maps REST APIs.
|
MapsAccountProperties
|
Additional Map account properties
|
name
|
The name of the SKU, in standard format (such as S0).
|
Sku
|
The SKU of the Maps Account.
|
systemData
|
Metadata pertaining to creation and last modification of the resource.
|
UserAssignedIdentity
|
User assigned identity properties
|
CorsRule
Specifies a CORS rule for the Map Account.
Name |
Type |
Description |
allowedOrigins
|
string[]
|
Required if CorsRule element is present. A list of origin domains that will be allowed via CORS, or "*" to allow all domains
|
CorsRules
Sets the CORS rules. You can include up to five CorsRule elements in the request.
Name |
Type |
Description |
corsRules
|
CorsRule[]
|
The list of CORS rules. You can include up to five CorsRule elements in the request.
|
createdByType
The type of identity that created the resource.
Name |
Type |
Description |
Application
|
string
|
|
Key
|
string
|
|
ManagedIdentity
|
string
|
|
User
|
string
|
|
customerManagedKeyEncryption
All Customer-managed key encryption properties for the resource.
encryption
(Optional) Discouraged to include in resource definition. Only needed where it is possible to disable platform (AKA infrastructure) encryption. Azure SQL TDE is an example of this. Values are enabled and disabled.
ErrorAdditionalInfo
The resource management error additional info.
Name |
Type |
Description |
info
|
object
|
The additional info.
|
type
|
string
|
The additional info type.
|
ErrorDetail
The error detail.
Name |
Type |
Description |
additionalInfo
|
ErrorAdditionalInfo[]
|
The error additional info.
|
code
|
string
|
The error code.
|
details
|
ErrorDetail[]
|
The error details.
|
message
|
string
|
The error message.
|
target
|
string
|
The error target.
|
ErrorResponse
Error response
Name |
Type |
Description |
error
|
ErrorDetail
|
The error object.
|
IdentityType
Values can be systemAssignedIdentity or userAssignedIdentity
Name |
Type |
Description |
delegatedResourceIdentity
|
string
|
|
systemAssignedIdentity
|
string
|
|
userAssignedIdentity
|
string
|
|
InfrastructureEncryption
Values are enabled and disabled.
Name |
Type |
Description |
disabled
|
string
|
|
enabled
|
string
|
|
KeyEncryptionKeyIdentity
All identity configuration for Customer-managed key settings defining which identity should be used to auth to Key Vault.
Name |
Type |
Description |
delegatedIdentityClientId
|
string
|
delegated identity to use for accessing key encryption key Url. Ex: /subscriptions/fa5fc227-a624-475e-b696-cdd604c735bc/resourceGroups//providers/Microsoft.ManagedIdentity/userAssignedIdentities/myId. Mutually exclusive with identityType systemAssignedIdentity and userAssignedIdentity - internal use only.
|
identityType
|
IdentityType
|
Values can be systemAssignedIdentity or userAssignedIdentity
|
userAssignedIdentityResourceId
|
string
|
user assigned identity to use for accessing key encryption key Url. Ex: /subscriptions/fa5fc227-a624-475e-b696-cdd604c735bc/resourceGroups//providers/Microsoft.ManagedIdentity/userAssignedIdentities/myId. Mutually exclusive with identityType systemAssignedIdentity and delegatedResourceIdentity.
|
kind
Get or Set Kind property.
Name |
Type |
Description |
Gen1
|
string
|
|
Gen2
|
string
|
|
LinkedResource
Linked resource is reference to a resource deployed in an Azure subscription, add the linked resource uniqueName
value as an optional parameter for operations on Azure Maps Geospatial REST APIs.
Name |
Type |
Description |
id
|
string
|
ARM resource id in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/accounts/{storageName}'.
|
uniqueName
|
string
|
A provided name which uniquely identifies the linked resource.
|
ManagedServiceIdentity
Managed service identity (system assigned and/or user assigned identities)
Name |
Type |
Description |
principalId
|
string
|
The service principal ID of the system assigned identity. This property will only be provided for a system assigned identity.
|
tenantId
|
string
|
The tenant ID of the system assigned identity. This property will only be provided for a system assigned identity.
|
type
|
ManagedServiceIdentityType
|
Type of managed service identity (where both SystemAssigned and UserAssigned types are allowed).
|
userAssignedIdentities
|
<string,
UserAssignedIdentity>
|
User-Assigned Identities
The set of user assigned identities associated with the resource. The userAssignedIdentities dictionary keys will be ARM resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}. The dictionary values can be empty objects ({}) in requests.
|
ManagedServiceIdentityType
Type of managed service identity (where both SystemAssigned and UserAssigned types are allowed).
Name |
Type |
Description |
None
|
string
|
|
SystemAssigned
|
string
|
|
SystemAssigned, UserAssigned
|
string
|
|
UserAssigned
|
string
|
|
MapsAccount
An Azure resource which represents access to a suite of Maps REST APIs.
Name |
Type |
Default value |
Description |
id
|
string
|
|
Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
|
identity
|
ManagedServiceIdentity
|
|
Managed service identity (system assigned and/or user assigned identities)
|
kind
|
kind
|
Gen1
|
Get or Set Kind property.
|
location
|
string
|
|
The geo-location where the resource lives
|
name
|
string
|
|
The name of the resource
|
properties
|
MapsAccountProperties
|
|
The map account properties.
|
sku
|
Sku
|
|
The SKU of this account.
|
systemData
|
systemData
|
|
Metadata pertaining to creation and last modification of the resource.
|
tags
|
object
|
|
Resource tags.
|
type
|
string
|
|
The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
|
MapsAccountProperties
Additional Map account properties
Name |
Type |
Default value |
Description |
cors
|
CorsRules
|
|
Specifies CORS rules for the Blob service. You can include up to five CorsRule elements in the request. If no CorsRule elements are included in the request body, all CORS rules will be deleted, and CORS will be disabled for the Blob service.
|
disableLocalAuth
|
boolean
|
False
|
Allows toggle functionality on Azure Policy to disable Azure Maps local authentication support. This will disable Shared Keys and Shared Access Signature Token authentication from any usage.
|
encryption
|
encryption
|
|
(Optional) Discouraged to include in resource definition. Only needed where it is possible to disable platform (AKA infrastructure) encryption. Azure SQL TDE is an example of this. Values are enabled and disabled.
|
linkedResources
|
LinkedResource[]
|
|
The array of associated resources to the Map account. Linked resource in the array cannot individually update, you must update all linked resources in the array together. These resources may be used on operations on the Azure Maps REST API. Access is controlled by the Map Account Managed Identity(s) permissions to those resource(s).
|
provisioningState
|
string
|
|
The provisioning state of the Map account resource, Account updates can only be performed on terminal states. Terminal states: Succeeded and Failed
|
uniqueId
|
string
|
|
A unique identifier for the maps account
|
name
The name of the SKU, in standard format (such as S0).
Name |
Type |
Description |
G2
|
string
|
|
S0
|
string
|
|
S1
|
string
|
|
Sku
The SKU of the Maps Account.
Name |
Type |
Description |
name
|
name
|
The name of the SKU, in standard format (such as S0).
|
tier
|
string
|
Gets the sku tier. This is based on the SKU name.
|
systemData
Metadata pertaining to creation and last modification of the resource.
Name |
Type |
Description |
createdAt
|
string
|
The timestamp of resource creation (UTC).
|
createdBy
|
string
|
The identity that created the resource.
|
createdByType
|
createdByType
|
The type of identity that created the resource.
|
lastModifiedAt
|
string
|
The timestamp of resource last modification (UTC)
|
lastModifiedBy
|
string
|
The identity that last modified the resource.
|
lastModifiedByType
|
createdByType
|
The type of identity that last modified the resource.
|
UserAssignedIdentity
User assigned identity properties
Name |
Type |
Description |
clientId
|
string
|
The client ID of the assigned identity.
|
principalId
|
string
|
The principal ID of the assigned identity.
|