Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ReleasePR @azure/arm-authorization] document tenantId query parameter for cross-tenant role assignment ge… #12781

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion sdk/authorization/arm-authorization/LICENSE.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
The MIT License (MIT)

Copyright (c) 2019 Microsoft
Copyright (c) 2020 Microsoft

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
56 changes: 24 additions & 32 deletions sdk/authorization/arm-authorization/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,33 +15,32 @@ npm install @azure/arm-authorization

### How to use

#### nodejs - Authentication, client creation and list classicAdministrators as an example written in TypeScript.
#### nodejs - client creation and list classicAdministrators as an example written in TypeScript.

##### Install @azure/ms-rest-nodeauth

- Please install minimum version of `"@azure/ms-rest-nodeauth": "^3.0.0"`.
```bash
npm install @azure/ms-rest-nodeauth
npm install @azure/ms-rest-nodeauth@"^3.0.0"
```

##### Sample code

```javascript
While the below sample uses the interactive login, other authentication options can be found in the [README.md file of @azure/ms-rest-nodeauth](https://www.npmjs.com/package/@azure/ms-rest-nodeauth) package
```typescript
const msRestNodeAuth = require("@azure/ms-rest-nodeauth");
const { AuthorizationManagementClient } = require("@azure/arm-authorization");
const { interactiveLogin } = require("@azure/ms-rest-nodeauth");

const subscriptionId = process.env["AZURE_SUBSCRIPTION_ID"];

interactiveLogin()
.then((creds) => {
const client = new AuthorizationManagementClient(creds, subscriptionId);
client.classicAdministrators.list().then((result) => {
console.log("The result is:");
console.log(result);
});
})
.catch((err) => {
console.error(err);
msRestNodeAuth.interactiveLogin().then((creds) => {
const client = new AuthorizationManagementClient(creds, subscriptionId);
client.classicAdministrators.list().then((result) => {
console.log("The result is:");
console.log(result);
});
}).catch((err) => {
console.error(err);
});
```

#### browser - Authentication, client creation and list classicAdministrators as an example written in JavaScript.
Expand All @@ -57,7 +56,6 @@ npm install @azure/ms-rest-browserauth
See https://github.com/Azure/ms-rest-browserauth to learn how to authenticate to Azure in the browser.

- index.html

```html
<!DOCTYPE html>
<html lang="en">
Expand All @@ -71,27 +69,21 @@ See https://github.com/Azure/ms-rest-browserauth to learn how to authenticate to
const subscriptionId = "<Subscription_Id>";
const authManager = new msAuth.AuthManager({
clientId: "<client id for your Azure AD app>",
tenant: "<optional tenant for your organization>",
tenant: "<optional tenant for your organization>"
});
authManager.finalizeLogin().then((res) => {
if (!res.isLoggedIn) {
// may cause redirects
authManager.login();
}
const client = new Azure.ArmAuthorization.AuthorizationManagementClient(
res.creds,
subscriptionId
);
client.classicAdministrators
.list()
.then((result) => {
console.log("The result is:");
console.log(result);
})
.catch((err) => {
console.log("An error occurred:");
console.error(err);
});
const client = new Azure.ArmAuthorization.AuthorizationManagementClient(res.creds, subscriptionId);
client.classicAdministrators.list().then((result) => {
console.log("The result is:");
console.log(result);
}).catch((err) => {
console.log("An error occurred:");
console.error(err);
});
});
</script>
</head>
Expand All @@ -103,4 +95,4 @@ See https://github.com/Azure/ms-rest-browserauth to learn how to authenticate to

- [Microsoft Azure SDK for Javascript](https://github.com/Azure/azure-sdk-for-js)

![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-js%2Fsdk%2Fauthorization%2Farm-authorization%2FREADME.png)
![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-js/sdk/authorization/arm-authorization/README.png)
14 changes: 7 additions & 7 deletions sdk/authorization/arm-authorization/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
"description": "AuthorizationManagementClient Library with typescript type definitions for node.js and browser.",
"version": "8.3.3",
"dependencies": {
"@azure/ms-rest-azure-js": "^2.0.0",
"@azure/ms-rest-js": "^2.0.3",
"tslib": "^1.9.3"
"@azure/ms-rest-azure-js": "^2.0.1",
"@azure/ms-rest-js": "^2.0.4",
"tslib": "^1.10.0"
},
"keywords": [
"node",
Expand All @@ -20,11 +20,11 @@
"module": "./esm/authorizationManagementClient.js",
"types": "./esm/authorizationManagementClient.d.ts",
"devDependencies": {
"typescript": "^3.1.1",
"rollup": "^0.66.2",
"rollup-plugin-node-resolve": "^3.4.0",
"typescript": "^3.5.3",
"rollup": "^1.18.0",
"rollup-plugin-node-resolve": "^5.2.0",
"rollup-plugin-sourcemaps": "^0.4.2",
"uglify-js": "^3.4.9"
"uglify-js": "^3.6.0"
},
"homepage": "https://github.com/Azure/azure-sdk-for-js/tree/master/sdk/authorization/arm-authorization",
"repository": {
Expand Down
6 changes: 3 additions & 3 deletions sdk/authorization/arm-authorization/rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,15 @@ const config = {
"@azure/ms-rest-azure-js": "msRestAzure"
},
banner: `/*
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
* Copyright (c) Microsoft Corporation.
* Licensed under the MIT License.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
*/`
},
plugins: [
nodeResolve({ module: true }),
nodeResolve({ mainFields: ['module', 'main'] }),
sourcemaps()
]
};
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
/*
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for
* license information.
* Copyright (c) Microsoft Corporation.
* Licensed under the MIT License.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
* Changes may cause incorrect behavior and will be lost if the code is
Expand All @@ -20,10 +19,10 @@ class AuthorizationManagementClient extends AuthorizationManagementClientContext
classicAdministrators: operations.ClassicAdministrators;
globalAdministrator: operations.GlobalAdministrator;
providerOperationsMetadata: operations.ProviderOperationsMetadataOperations;
roleAssignments: operations.RoleAssignments;
permissions: operations.Permissions;
roleDefinitions: operations.RoleDefinitions;
denyAssignments: operations.DenyAssignments;
roleAssignments: operations.RoleAssignments;

/**
* Initializes a new instance of the AuthorizationManagementClient class.
Expand All @@ -36,10 +35,10 @@ class AuthorizationManagementClient extends AuthorizationManagementClientContext
this.classicAdministrators = new operations.ClassicAdministrators(this);
this.globalAdministrator = new operations.GlobalAdministrator(this);
this.providerOperationsMetadata = new operations.ProviderOperationsMetadataOperations(this);
this.roleAssignments = new operations.RoleAssignments(this);
this.permissions = new operations.Permissions(this);
this.roleDefinitions = new operations.RoleDefinitions(this);
this.denyAssignments = new operations.DenyAssignments(this);
this.roleAssignments = new operations.RoleAssignments(this);
}
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
/*
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for
* license information.
* Copyright (c) Microsoft Corporation.
* Licensed under the MIT License.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
* Changes may cause incorrect behavior and will be lost if the code is
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
* Copyright (c) Microsoft Corporation.
* Licensed under the MIT License.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
* Copyright (c) Microsoft Corporation.
* Licensed under the MIT License.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
* Copyright (c) Microsoft Corporation.
* Licensed under the MIT License.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
Expand Down
Loading