Access Policies - Create Or Update

Create or update an access policy in the specified environment.

PUT https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.TimeSeriesInsights/environments/{environmentName}/accessPolicies/{accessPolicyName}?api-version=2018-08-15-preview

URI Parameters

Name In Required Type Description
subscriptionId
path True
  • string

Azure Subscription ID.

resourceGroupName
path True
  • string

Name of an Azure Resource group.

environmentName
path True
  • string

The name of the Time Series Insights environment associated with the specified resource group.

accessPolicyName
path True
  • string

Name of the access policy.

Regex pattern: ^[-\w\._\(\)]+$

api-version
query True
  • string

Version of the API to be used with the client request.

Request Body

Name Type Description
properties.description
  • string

An description of the access policy.

properties.principalObjectId
  • string

The objectId of the principal in Azure Active Directory.

properties.roles
  • string[]

The list of roles the principal is assigned on the environment.

Responses

Name Type Description
200 OK

The existing access policy definition was successfully updated.

201 Created

The access policy was successfully created.

Other Status Codes

HTTP 400 (Bad Request): The given access policy request body is invalid; See the error code and message in the response for details.

Examples

AccessPoliciesCreate

Sample Request

PUT https://management.azure.com/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.TimeSeriesInsights/environments/env1/accessPolicies/ap1?api-version=2018-08-15-preview
{
  "properties": {
    "principalObjectId": "aGuid",
    "roles": [
      "Reader"
    ],
    "description": "some description"
  }
}

Sample Response

{
  "id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.TimeSeriesInsights/Environments/env1/accessPolicies/ap1",
  "name": "ap1",
  "type": "Microsoft.TimeSeriesInsights/Environments/AccessPolicies",
  "properties": {
    "principalObjectId": "aGuid",
    "roles": [
      "Reader"
    ],
    "description": "some description"
  }
}
{
  "id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.TimeSeriesInsights/Environments/env1/accessPolicies/ap1",
  "name": "ap1",
  "type": "Microsoft.TimeSeriesInsights/Environments/AccessPolicies",
  "properties": {
    "principalObjectId": "aGuid",
    "roles": [
      "Reader"
    ],
    "description": "some description"
  }
}

Definitions

AccessPolicyCreateOrUpdateParameters
AccessPolicyResource

An access policy is used to grant users and applications access to the environment. Roles are assigned to service principals in Azure Active Directory. These roles define the actions the principal can perform through the Time Series Insights data plane APIs.

CloudError

Contains information about an API error.

CloudErrorBody

Describes a particular API error with an error code and a message.

AccessPolicyCreateOrUpdateParameters

Name Type Description
properties.description
  • string

An description of the access policy.

properties.principalObjectId
  • string

The objectId of the principal in Azure Active Directory.

properties.roles
  • string[]

The list of roles the principal is assigned on the environment.

AccessPolicyResource

An access policy is used to grant users and applications access to the environment. Roles are assigned to service principals in Azure Active Directory. These roles define the actions the principal can perform through the Time Series Insights data plane APIs.

Name Type Description
id
  • string

Resource Id

name
  • string

Resource name

properties.description
  • string

An description of the access policy.

properties.principalObjectId
  • string

The objectId of the principal in Azure Active Directory.

properties.roles
  • string[]

The list of roles the principal is assigned on the environment.

type
  • string

Resource type

CloudError

Contains information about an API error.

Name Type Description
error

Describes a particular API error with an error code and a message.

CloudErrorBody

Describes a particular API error with an error code and a message.

Name Type Description
code
  • string

An error code that describes the error condition more precisely than an HTTP status code. Can be used to programmatically handle specific error cases.

details

Contains nested errors that are related to this error.

message
  • string

A message that describes the error in detail and provides debugging information.

target
  • string

The target of the particular error (for example, the name of the property in error).