Coder Social home page Coder Social logo

Comments (4)

lawrencegripper avatar lawrencegripper commented on August 18, 2024

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.

lawrencegripper avatar lawrencegripper commented on August 18, 2024

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.

 avatar commented on August 18, 2024

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.

 avatar commented on August 18, 2024

I've added a couple of tasks that should resolve this issue.

from azure-sdk-for-js.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.