Comments (4)
I've had a go at moving to to have the following script
imports
<script src="node_modules/ms-rest-js/dist/msRest.browser.js"></script>
<script src="node_modules/ms-rest-azure-js/dist/msRestAzure.js"></script>
<script src="node_modules/ms-rest-browserauth/dist/msAuth.js"></script>
<script src="node_modules/azure-arm-containerinstance/lib/containerInstanceManagementClient.js"></script>
And install these additional packages:
npm install --save ms-rest-js
npm install --save ms-rest-azure-js
npm install --save ms-rest-browserauth
But I get an error from the browser as containerInstanceManagementClient.js
uses require and looks like it expects to be run under node
.
Sorry if I've missed a section of docs which picks this up
from azure-sdk-for-js.
So it looks like the install instructions pull down the npm package for nodejs not the isomorphic sdk.
I picked up the drop.zip from the releases on the repo and then pulled the source from there along with the three npm packages install above and this seems to be working.
The following now works
<!-- AzureSDK Import -->
<script src="node_modules/ms-rest-js/dist/msRest.browser.js"></script>
<script src="node_modules/ms-rest-azure-js/dist/msRestAzure.js"></script>
<script src="node_modules/ms-rest-browserauth/dist/msAuth.js"></script>
<script src="azure-containerinstance/dist/arm-containerinstance.js"></script>
<script type="text/javascript">
var ws = "";
var token = "tokenhere";
var subscriptionId = "subidhere"
createACIInstance(token, subscriptionId);
function createACIInstance(token, subscriptionId) {
const creds = new msRest.TokenCredentials(token);
const client = new Azure.ArmContainerinstance.ContainerInstanceManagementClient(creds, subscriptionId);
client.containerGroups.list().then((result) => {
console.log("The result is:");
console.log(result);
}).catch((err) => {
console.log("An error occurred:");
console.error(err);
});
}
</script>
Is it worth PRing some updated instructions or are the pages autogen'd?
Looking at this in relation to the other issues I raised #414 and #413 have I stumbled into a repository in a 'in-progress' state? If so it would be great to call this out in the Readme
so users know that docs and samples may be outdates and there aren't any NPM packages released yet.
from azure-sdk-for-js.
These are really good points. Thanks for the feedback. We'll update our package README.md files so that they better explain which packages you need to install.
Sorry that you experienced this repository while it is a work in progress. We're going to be publishing these packages really soon, so by the time that we updated our README.md to explain that this repository is a work in progress, people would be able to start installing the packages.
from azure-sdk-for-js.
I've added a couple of tasks that should resolve this issue.
from azure-sdk-for-js.
Related Issues (20)
- [docs] broken links in arm-quota HOT 1
- [search] Results that are unrelated to the query are returned HOT 3
- Request for Including Registry Component in arm-machinelearning HOT 4
- The sample code doesn't work with the latest @azure/openai (Node.js) HOT 3
- [Question] How to create SAS token for folders? HOT 9
- [Communication Services - Call Automation] Raw media access on the server (Rooms Calls) HOT 2
- [core] core-client-rest `PathUnchecked` does not infer path parameters which are not preceded by `/`
- read ECONNRESET when trying to stream GPT response with a PTU deployment HOT 5
- `@azure/monitor-opentelemetry` ignoes AZURE_LOG_LEVEL setting when `APPLICATIONINSIGHTS_INSTRUMENTATION_LOGGING_LEVEL` is not set
- TS2305: Module '"@azure/openai"' has no exported member 'AzureKeyCredential'. HOT 4
- ResourceNotFound error when connecting to Azure OpenAI using latest JavaScript SDK (version 2.0.0-beta.1) HOT 3
- [Core] add ResourceId support
- Ali963.sy
- Refresh all the rlc sdks in sdk repo HOT 5
- can not validate the authority HOT 2
- How to use aggregation with @azure/cosmos in nosql database HOT 2
- Unable to resolve module crypto - @azure/notification-hubs HOT 1
- [feature request] adding `generateSasStringToSign` for other packages
- [Service Bus] PartitionedSubscriptionWithSessions: deleteMessages (session) failing in nightly runs HOT 2
- [Storage - File Datalake] macoslatest_224x_node failing in nightly runs
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from azure-sdk-for-js.